以下程序的运行结果是。#includeint main(){ int a[]={1,2,3,4,5,6,7,8,9,10,11,12}; int *p=a+5,*q=a; *q=*(p+5); printf("%d %d \n",*p,*q); return 0;}
A. 6 11
B. 6 6
C. 6 12
D. 5 5
查看答案
以下程序的输出结果为 。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;}
ABCDEFGHIJKL
B. ABCD
C. ABCDEFGHIJKLMNOP
D. AEIM
设有以下语句: char str1[]="string",str2[8],*str3,*str4="string";则下面选项不是对库函数strcpy的正确调用,此库函数用于复制字符串。
A. strcpy(str1,"HELLO1");
B. strcpy(str2,"HELLO2");
C. strcpy(str3,"HELLO3");
D. strcpy(str4,"HELLO4");
若有以下定义和语句:#includeint main(){ char *s1="12345",*s2="1234"; printf("%d\n",strlen(strcpy(s1,s2))); return 0;}则输出结果是。
A. 4
B. 5
C. 9
D. 10
分析以下四个程序中,哪一个不能对两个整型变量的值进行交换。
A.
B. includevoid swap(int *p,int *q);{ int *t; t=p;p=q;q=t;}int main(){ int a=10,b=20; swap(&a,&b); printf("%d %d\n",a,
C. ;return 0;} B、
D. includevoid swap(int *p,int *q);{ int t; t=*p;*p=*q;*q=t;}int main(){ int a=10,b=20; swap(&a,&b); printf("%d %d\n",a,b);return 0;}
E. C.
F. include void swap(int *p,int *q){ int t; t=*p;*p=*q;*q=t;}int main(){ int x,y,*a=&x,*b=&y; *a=10,*b=20; swap(a,b); printf("%d %d\n",*a,*b); return 0;}
G. D.
H. includevoid swap(int *p,int *q);{ int t; t=*p;*p=*q;*q=t;}int main(){ int a=10,b=20; int *x=&a,*y=&b; swap(x,y); printf("%d %d\n",a,b); return 0;}