C语言第10章
- 格式:ppt
- 大小:872.00 KB
- 文档页数:78


1.若有说明:int i,j=7, *p=&i;,则与i=j;等价的语句是(B )。
(A)i= *p; (B)*p=*&j; (C)i=&j; (D)i=* *p;2.若有以下说明:int a[10]={1,2,3,4,5,6,7,8,9,10},*p=a;则数值为6的表达式是( C)。
(A)*p+6 (B)*(p+6) (C)*p+=5 (D)p+53.若有以下定义和语句:char *s1="12345",*s2="1234";printf("%d\n",strlen(strcpy(s1,s2)));则输出结果是( A)。
(A)4 (B)5 (C)9 (D)104.以下不能正确进行字符串赋初值的语句是(A )。
(A) char str[5]="good!"; (B) char str[]="good!";(C) char *str="good!"; (D) char str[5]={‘g',‘o',‘o',‘d'};5.若定义:int a=511,*b=&a;, 则printf("%d\n",*b);的输出结果为( D )。
(A) 无确定值 (B) a的地址 (C) 512 (D) 5116.下面程序的输出是( A )。
(A) 3 (B) 4 (C) 1 (D) 2main(){ int a[10]={ 1,2,3,4,5,6,7,8,9,10},*p=a;printf("%d\n",*(p+2));}7.若有说明:int n=2,*p=&n,*q=p;,则以下非法的赋值语句是(D )。
(A) p=q; (B) *p=*q; (C) n=*q; (D) p=n;8.有如下说明int a[10]={1,2,3,4,5,6,7,8,9,10},*p=a;则数值为9的表达式是( B )。