题目内容

以下程序的功能是:int main(){int a=10,b=20,t;int *x=&a,*y=&b;t=*x;*x=*y;*y=t;return 0;}

A. 交换a,b两个变量的值
B. 交换a,b两个变量的地址
C. 比较a,b的大小 以上都错
D. 都错

查看答案
更多问题

以下程序的输出结果是()。void prtv(int *x){printf("%d\n", ++*x);}int main(){int a = 25;prtv(&a);return 0;}

A. 24
B. 26
C. 23
D. 25

以下程序的输出结果是()。#include #include void fun( char *w, int m){char s, *p1, *p2;p1 = w;p2 = w+m-1;while(p1 < p2){s = *p1 ++;*p1 = *p2--;*p2 = s;}}int main(){char a[] = "ABCDEFG";fun(a, strlen(a));puts(a);return 0;}

AGADAGA
B. AGAAGAG
C. GFEDCBA
D. GAGGAGA

以下程序的输出结果是()。int main(){int a[5] = {2, 4, 6, 8, 10}, *p, **k;p = a;k = &p;printf("%d ", *(p++));printf("%d\n", **k);return 0;}

A. 4 6
B. 2 2
C. 2 4
D. 4 4

以下程序的输出结果是()。int main(){char *alpha[6] = {"ABCD","EFGH","iJKL","MNOP","QRST","UVWX"};char **p;int i;p = alpha;for(i = 0; i < 4; i++)printf("%s", p[i]);printf("\n");return 0;}

ABCD
B. AEiM
C. ABCDEFGHiJKL
D. ABCDEFGHiJKLMNOP

答案查题题库