c语言帮忙看看为什么输出z的值会报错,怎么修正 - 爱问答

(爱问答)

c语言帮忙看看为什么输出z的值会报错,怎么修正

#include<stdio.h>

 

struct student

{

int age;

char name[20];

 

};

 

int main()

{

struct student student1[10]=

 

{

{17,"zhangsan"},

{18,"lisi"},

{none,"unknow"}

 

};

 

int a = student1[0].age ;

char z = student1[0].name;       //<===

 

printf("%s ",z);                           //<===

 

return 0;

}


typedef struct stu{
char name[namelen];
char sex;
char num;
int age;
struct scores score;
}student;
这里边sex和num应定义为char数组
student stu[LEN];这里的stu和结构体名冲突了

相关标签:c语言

下一篇:电脑闪黑屏

上一篇:静态方法没有什么参数,无法访问实例变量

热门标签:
excel 网盘 破解 word dll
最新更新:
微软重新评估新的Outlook的使用时机 联想推出搭载联发科Helio G80芯片组的Tab M9平板 英特尔创新大赛时间确定! 微软Edge浏览器在稳定渠道中推出Workspaces功能 英伟达RTX4060TiGPU推出MaxSun动漫主题! 谷歌地图为用户提供了街景服务! GameSir 在T4 Kaleid中推出了一款出色的控制器! 微软开始在Windows 11 中测试其画图应用程序的新深色模式! LG电子推出全球首款无线OLED电视 英伟达人工智能芯片崭露头角! Steam Deck可以玩什么游戏-Steam Deck价格限时优惠 雷蛇推出CobraPro鼠标 Kindle电子阅读器可以访问谷歌商店吗 Windows10如何加入组策略 window10图片查看器怎么没有了?