有以下程序#include int k=5;void f(int *s){ *s=k; }main(){ int m=3,*p=&m;f(p);printf("%d,%d", m, *p);}程序的运行结果是
A. 5,5
B. 3,3
C. 3,5
D. 5,3
查看答案
有以下程序#include int k=5;void f(int *s){ s=&k; }main(){ int m=3,*p=&m;f(p);printf("%d,%d\n", m, *p);}程序的运行结果是
A. 3,3
B. 5,5
C. 3,5
D. 5,3
有以下程序#include void fun( int *s, int t, int *k ){ int p;for( p=0, *k=p; ps[*k] ) *k = p;}main(){int a[10] = { 11,12,13,14,15,16,20,18,19,10 },k ;fun( a,10,&k );printf( "%d,%d\n",k, a[k] );}程序运行后的输出结果是
A. 6,20
B. 10,9
C. 7,20
D. 10,10
有以下程序#include main(){char *s[6] = { "ABCD", "EFGH","IJKL","MNOP","QRST","UVWX" }, **p ;int i;p = s;for( i = 0; i<4; i++ ) printf( "%s", p[i] );printf( "\n" );}程序运行后的输出结果是
ABCDEFGHIJKLMNOP
B. ABCDEFGHIJKL
C. ABCD
D. AEIM
以下选项中,不能对主函数中变量i和j的值进行交换的程序是
A.
B. include void swap( int *p,int *q){ int *t; *t=*p; *p=*q; *q=*t;}main(){ int i=10,j=20, *a=&i, *b=&j; swap(a,b); printf("i=%d j= %d\n", i,j );}
C. B.
D. include void swap( int *p,int *q){ int t; t=*p; *p=*q; *q=t;}main(){ int i=10,j=20, *a=&i, *b=&j; swap(a,b); printf("i=%d j= %d\n", i,j );}
E. C.
F. include
G. include void swap( int *p,int *q){ int *t; t=(int *)malloc(sizeof(int)); *t=*p; *p=*q; *q=*t; free(t);}main(){ int i=10,j=20; swap(&i,&j); printf("i=%d j= %d\n", i,j );}
H. D.
I. include void swap( int *p,int *q){ int t; t=*p; *p=*q; *q=t;}main(){ int i=10,j=20 , *x=&i, *y=&j; swap(x,y); printf("i=%d j= %d\n", i,j );}