单选题 C++
题号 #2607488

下面程序的运行结果是(  )。
#include<iostream.h>
void fun(int *a,int *B. {
int x=*a:
*a=*b;*b=X;
cout<<*a<<*b<<””:
void main() {
int X=1,Y=2; fun(&x,&y);
cout<<x<<Y<<endl;
}

进入在线模考

参考答案

D

答案解析

本题考查的是指针和引用,函数fun完成把x和Y互换的操作。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考