【单选题】
# include void main ( ) { int a = -1, b = 1; void f1(int x, int y), f2(int *x, int *y); void f3(int *x, int *y), f4(int x, int y); f1(a, b); printf("(%d,%d)\n", a, b); a = -1, b = 1; f2(&a, &b); printf("(%d,%d)\n", a, b); a = -1, b = 1; f3(&a, &b); printf("(%d,%d)\n", a, b); a = -1, b = 1; f4(a, b); printf("(%d,%d)\n", a, b); } void f1(int x, int y) { int t; t = x; x = y; y = t; } void f2(int *x, int *y) { int t; t = *x; *x = *y; *y = t; } void f3(int *x, int *y) { int *t; t = x; x = y; y = t; } void f4(int x, int y) { int *t = malloc(sizeof(t)); *t = x; x = y; y = *t; } 程序运行时,第 3 行输出:
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
收藏
举报
参考答案:
参考解析: