以下不是将字符串Code存储到数组中的语句是( )。
A: char s[]="Code";
B: char s[]= {'C','o','d','e','\0'};
C: char s[]= {'C','o','d','e'};
D: char s[5]= {'C','o','d','e'};
A: char s[]="Code";
B: char s[]= {'C','o','d','e','\0'};
C: char s[]= {'C','o','d','e'};
D: char s[5]= {'C','o','d','e'};
举一反三
- 以下能正确进行字符串赋值的语句是() A: char<br/>s[5]; s="good!"; B: char<br/>s[5]={'a','e','i','o','u'}; C: char<br/>s[5]="good!"; D: char<br/>*s; s="good!";
- 能正确进行字符串赋值的是( )。 A: char s[5]={'a','e','i','o','u'}; B: char s[5]; s="good"; C: char s[5]="abcd"; D: char s[5]; s[ ]="good";
- 要使字符数组str存放一个字符串"progress",正确的定义语句是( )。 A: char str[8]={'p','r','o','g','r','e','s','s'}; B: char str[8]="progress"; C: char str[]={'p','r','o','g','r','e','s','s'}; D: char str[]="progress";
- 下面各语句行中,能正确进行字符串赋值操作的语句是: A: char *s;scanf("%s",s); B: char st[4][5]={"HELLO"}; C: char s[5]={'H', 'E', 'L', 'L', 'O'}; D: char * s;s="HELLO";
- 以下定义语句中不能将字符串"world"正确赋给字符数组的是( ) A: char s[]="world"; B: char s[10];<br>strcpy(b,"world"); C: char s[6];s={ "world"}; D: char s[]={ 'w','o','r','l','d', '\0'};