下列字符串赋值方式不正确的是( )
A: A.char str[20]; str="I am a boy!";
B: B.char *str; str="I am a boy!";
C: C.char *str="I am a boy!";
D: D.char str[20]=" I am a boy!";
A: A.char str[20]; str="I am a boy!";
B: B.char *str; str="I am a boy!";
C: C.char *str="I am a boy!";
D: D.char str[20]=" I am a boy!";
举一反三
- 下列字符串赋值方式不正确的是( ) A: char str[20]; B: char *str ;str=”I am a boy!”; str=”I am a boy!”; C: char *str=”I am a boy!”; D: char str[20]=” I am a boy!”;
- 19.下列字符串赋值方式不正确的是 A: char str[20]; str=”I am a boy!”; B: char *str ; str=”I am a boy!”; C: char *str=”I am a boy!”; D: char str[20]=” I am a boy!”;
- 以下给字符数组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[]={'084'}; B: char str="kx43"; C: char str=""; D: char str[]="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[5]="good!"; B: char str[]="good!"; C: char *str="good!"; D: char str[ ]={‘g',‘o',‘o',‘d',‘!',‘0'};