以下错误的语句是___
A: char word[] = {'C','h','i','n','a'};
B: char word[] = {"china"};
C: char word[] = "china";
D: char word[] = 'china';
A: char word[] = {'C','h','i','n','a'};
B: char word[] = {"china"};
C: char word[] = "china";
D: char word[] = 'china';
举一反三
- 以下错误的语句是( ) A: charword[]={‘c’,’h’,’i’,’a’}; B: char word[]=’china’; C: charword[]={”china”}; D: char word[]=”china”;
- 与如下代码不等价的语句是________。 char str[ ] = "china"; A: char str[6] = “china”; B: char str[ ] = {'c', 'h', 'i', 'n', 'a'}; C: char str[ ] = {'c', 'h', 'i', 'n', 'a', '\0'}; D: char str[ ] = {"china"};
- 下列语句,错误的是: A: char s[]=”China”; B: char s[20]; s=”China”; C: char *sp=”China”; D: char *sp; sp=”China”;
- 不能把字符串"China"赋给数组b的语句是( )。 A: char b[10]={'C','h','i','n','a','\0'}; B: char b[10],b="China"; C: char b[10]; strcpy(b,"China"); D: char b[10]="China";
- 下列字符数组的定义和初始化中错误的是( )。 A: char s1[]="china"; B: char s2[]={"china"}; C: char s3[5]="china"; D: char s4[5]={'c','h','i','n','a'};