柠檬试题库
search
首页
计算机
公务员
驾照
关于
share
以下选项中,没有编译错误的是
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";
热度🔥899
参考答案:A
解析:
【解析】B选项中,不能直接将字符数组名直接赋值给另一个字符数组名。C选项赋值错误,不能将一个字符串常量赋值给一个字符指针。D选项定义str4时需要定义其长度。
复制题目向AI提问
content_copy
content_copy
扫码免费计算机二级刷题
2025年计算机等级考试题库
推荐
下面描述中,不属于软件危机表现的是( )。
有以下程序 #include main() { int a=2, b; b = a<<2; printf ("%d\n", b ); } 程序运行后的输出结果是
有以下程序 #include #include struct A { int a; char b[10]; double c; }; void f(struct A t); main() { struct A a={1001,"ZhangDa",1098.0}; f(a); printf("%d,%s,%6.1f\n", a.a,a.b,a.c); } void f(struct A t) { t.a=1002; strcpy(t.b,"ChangRong"); t.c=1202.0; } 程序运行后的输出结果是
下列关于日志备份的说法中,错误的是()
下列关于数据依赖的叙述中,哪一条是错误的?
标签
二级C语言
str
选项
char
字符