以下程序的输出结果是()。#include 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[]="";则下面选项()不是对库函数strcpy()的正确调用,此库函数用于复制字符串。
A. strcpy(str1,"HELLO1");
B. strcpy(str2,"HELLO2");
C. strcpy(str3,"HELLO3");
D. strcpy(str4,"HELLO4");
若有以下定义和语句,则输出结果是()。#include #include int main(){char a[5]="12345",b[5]="1234",*s1=a,*s2=b;printf("%d\n",strlen(strcpy(s1,s2)));return 0;}
A. 4
B. 5
C. 9
D. 10
下面的二维数组初始化语句中,错误的是()。
A. float b[2][2]={0.1,0.2,0.3,0.4};
B. float a[][2]={{0.1,0.2},{0.3,0.4}};
C. int a[][2]={1,2,3};
D. int a[][2]={1,2,3,4};
下列初始化字符数组的语句中,错误的是()。
A. char str[5]="hello";
B. char str[]={'h','e','l','l','o','\0'};
C. char str[5]="hi";
D. char str[100]="";