以下能正确进行字符串初始化的语句是( )
A: char str[] = "good!";
B: char str[8] = "good!";
C: char *str = "good!";
D: char str[5] = {'g', 'o', 'o', 'd', '!'};
A: char str[] = "good!";
B: char str[8] = "good!";
C: char *str = "good!";
D: char str[5] = {'g', 'o', 'o', 'd', '!'};
举一反三
- 以下不能正确进行字符串赋初值的语句是()。? char str[5]="good!";|char *str="good!";|char str[]="good!"; |char str[5]={ '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[]={'084'}; B: char str="kx43"; C: char str=""; D: char str[]="0";
- 以下给字符数组str定义和赋值正确的是( ) A: char str[10]; str={"china!"}; B: char str[]={"china!"}; C: char str[10]; strcpy(str,"abcdefghijkl"); D: char str[10]={"abcdefghijkl"};
- 以下能正确定义字符串的语句是( )。 A: char str[]="0"; B: char str[]={'ab84k'}; C: char str="x43"; D: char str[]='';