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

admin2020-11-23  20

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

选项 A、charstr3[]={’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/f03p777K
0

最新回复(0)