下列不能正确进行字符串初始化的是( )。
A: char str[8] = {'g', 'o', 'o', 'd', '!','\0'};
B: char str[8] = "good!";
C: char *str = "good!";
D: char str[] = {'g', 'o', 'o', 'd', '!'};
A: char str[8] = {'g', 'o', 'o', 'd', '!','\0'};
B: char str[8] = "good!";
C: char *str = "good!";
D: char str[] = {'g', 'o', 'o', 'd', '!'};
举一反三
- 以下不能正确进行字符串初始化的语句是: A: char str[5] = "good!"; B: char str[5] = {'g', 'o', 'o', 'd', '!'}; C: char str[] = {'g', 'o', 'o', 'd', '!'}; D: char str[] = "good!"; E: char str[8] = "good!"; F: char *str = "good!"; G: char str[8] = {'g', 'o', 'o', 'd', '!'};
- ( )不能对字符串赋初值.A) char str[5]="good!"; B) char str[]="good!";C) char *str="good!"; D) char str[ ]={‘g',‘o',‘o',‘d',‘!',‘\0'}; A: char str[5]="good!"; B: char str[]="good!"; C: char *str="good!"; D: char str[ ]={‘g',‘o',‘o',‘d',‘!',‘\0'};
- 以下能正确进行字符串初始化的语句是( ) A: char str[] = "good!"; B: char str[8] = "good!"; C: char *str = "good!"; D: char str[5] = {'g', 'o', 'o', 'd', '!'};
- 以下不能正确进行字符串赋初值的语句是( )。 A、char str[5]= "good!"; B、char *str="good!"; C、char str[]="good!"; D、char str[5]={'g', 'o','o', 'd'}; A: char *str="good!"; B: char str[5]={'g', 'o','o', 'd'}; C: char str[]="good!"; D: char str[5]= "good!";
- 以下不能正确进行字符串赋值初值的语句是( )。 A: char str[5]="good!"; B: char str[]="good!"; C: char *str="good!"; D: char str[5]={'g','o','o','d');