题目内容

下别那段代码不能完成变量a、b值的交换。

A. void swap(int *x,int *y){int t=*x;*x=*y;*y=t;}int main(){int a=10,b=20swap(&a,&b); cout< B. void swap(int &x,int &y){int t=x;x=y;y=t;}int main(){int a=10,b=20swap(a,b); cout< C. void swap(int *x,int *y){int *t=x;x=y;y=t;}int main(){int a=10,b=20;int a;swap(&a,&b); cout< D. void swap(int*&x,int *&y){int t=*x;*x=*y;*y=t;}int main(){int a=10,b=20; int*p=&a; int *q=&b;swap(p,q); cout<

查看答案
更多问题

树和图都属于数据的物理结构

A. 对
B. 错

建模时,先确定数据物理结构,再抽象出数据逻辑结构。

A. 对
B. 错

通信录属于非线性结构

A. 对
B. 错

指针可以用于描述数据元素之间的前驱、后继关系,实现复杂的数据结构。

A. 对
B. 错

答案查题题库