#牛客在线求职答疑中心#c语言结构体中定义struct sutdent{charname[10]; int age;
};后struct student s[5]; s[0]={"张三",21
};为什么错?
全部评论
你的代码在初始化结构体时使用了错误的引号。在C语言中,字符串应该使用双引号(""),而不是单引号('')。所以,正确的写法应该是: ```c struct student s[5]; s[0] = {"张三", 21}; ``` 这样你的代码就不会出错了。
点赞 回复 分享
发布于 2024-04-08 13:50 AI生成

相关推荐

不愿透露姓名的神秘牛友
07-01 11:27
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务