家人们,求帮忙看下错误
c语言吧
全部回复
仅看楼主
level 7
2022年05月10日 11点05分 1
level 7
家人们来帮我看下,正常输出不是应该是有后面的“传奇级别装备”吗,编译的时候有警告,但看不懂。 输出的时候就这个样了,只有一个字符串输出了。
x8.c: In function ‘main’:
x8.c:21:9: warning: braces around scalar initializer
21 | struct oga stu_a_zkc = {.age = 18, .level = 3000, {"张三", "传奇级别装备"}};
| ^~~
x8.c:21:9: note: (near initialization for ‘stu_a_zkc.bp_blm’)
x8.c:21:53: warning: initialization of ‘struct bcqq *’ from incompatible pointer type ‘char *’ [-Wincompatible-pointer-types]
21 | struct oga stu_a_zkc = {.age = 18, .level = 3000, {"张三", "传奇级别装备"}};
| ^~~~~~~~
x8.c:21:53: note: (near initialization for ‘stu_a_zkc.bp_blm’)
x8.c:21:63: warning: excess elements in scalar initializer
21 | struct oga stu_a_zkc = {.age = 18, .level = 3000, {"张三", "传奇级别装备"}};
| ^~~~~~~~~~~~~~~~~~~~
x8.c:21:63: note: (near initialization for ‘stu_a_zkc.bp_blm’)
2022年05月10日 11点05分 2
level 7

2022年05月10日 14点05分 3
level 7
@cainslayer
中午睡了一觉起来,然后看了大佬的评论,思路就打开了! 大佬能加你个联系方式不
2022年05月11日 13点05分 5
1