以下选项中,没有编译错误的是

admin2019-12-17  23

问题 以下选项中,没有编译错误的是

选项 A、char str3[]={’d’,’e’,’b’,’u’,’g’,’\0’};
B、char str1[5]="pass",str2[6];str2=str1;
C、char name[10];name="china";
D、char str4[];str4="hello world";

答案A

解析 选项A是定义了字符数组str3[].并对其赋初值。选项B中语句str2=str1非法,字符数组小能直接赋值。选项C,D)和选项B一致。
转载请注明原文地址:https://kaotiyun.com/show/VsCp777K
0

最新回复(0)