题目内容

以下定义语句中,错误的是()。

A. int a[]={1,2};
B. char *a="abc";
C. char s[10]="test";
D. int n=5,a[n];

查看答案
更多问题

下列选项中,合法的数组定义是( )。

A. int a[]="string";
B. int a[5]={0,1,2,3,4,5};
C. char s[]="string";
D. char a[]={a,b,c,d,e};

在以下定义中,正确的说明语句为( D )。

A. int a[b]
B. int a[3,4]
C. int a[][]
D. int *a[10]

若有定义char s[5] = { 'h', 'e', 'l', 'l', 'o' };则printf(“%s”,s);的输出结果为(

A. 输出字符串hello后乱码
B. hello
C. h
D. 输出数组s的地址

若有定义char str1[] = “abc”Char str2[] = “dkgabcls”;则调用strstr(str1,str2)函数,下列描述中正确的是()

A. 调用strstr(str1,str2)是在字符串str2中查找字符串str1第一次出现的位置
B. strstr(str1,str2)输出结果为abc
C. strstr(str1,str2)输出结果为abcls
D. strstr(str1,str2)输出结果为NULL

答案查题题库