char str[]=“China”; 等价于
A: char str[5]={‘C’, ‘h’, ‘i’, ‘n’, ‘a’,’0’};
B: char str[6]={‘C’, ‘h’, ‘i’, ‘n’, ‘a’,’0’};
C: char str[5]={‘C’, ‘h’, ‘i’, ‘n’, ‘a’};
D: char str[6]={‘C’, ‘h’, ‘i’, ‘n’, ‘a’};
A: char str[5]={‘C’, ‘h’, ‘i’, ‘n’, ‘a’,’0’};
B: char str[6]={‘C’, ‘h’, ‘i’, ‘n’, ‘a’,’0’};
C: char str[5]={‘C’, ‘h’, ‘i’, ‘n’, ‘a’};
D: char str[6]={‘C’, ‘h’, ‘i’, ‘n’, ‘a’};
举一反三
- 与如下代码不等价的语句是________。 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"};
- 06410011:与char str[]={“china”};初始化赋值不等价的是( )。 A: char str[]=“china”; B: char str[6]={‘c’,’h’,’i’,’n’,’a’,’\o’}; C: char str[]={‘c’,’h’,’i’,’n’,’a’,’\o’}; D: char str[]={‘c’,’h’,’i’,’n’,’a’};
- 下面的定义语句中,使数组str不能正确保存字符串的是()。 A: char str[6]="China"; B: char str[ ]="China"; C: char str[5]={'C','h','i','n','a'}; D: char str[6]={"China"};
- 下面的定义语句中,使数组str不能正确保存字符串的是()。 A: char str[6]="China"; B: char str[ ]="China"; C: char str[5]={'C','h','i','n','a'}; D: char str[6]={"China"};
- 执行下面的初始化语句,( )保存的不是字符串。 A: char str[10]= { 'S' ,'t', 'r' ,'i','n', 'g','\0'}; B: char str[10]= "String"; C: char str[6]= { 'S' ,'t', 'r' ,'i','n', 'g'}; D: char str[]= { 'S' ,'t', 'r' ,'i','n', 'g',0};