c语言代码没有错误运行提示停止工作,求助,一运行这个程序就提示已停止工作,编译没有问题。...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

Compilation finished with warnings:

source.c:4:86: warning: suggest braces around initialization of subobject [-Wmissing-braces]

struct teacher{int num;char name[20];char sex;float score[3]; }tec={1472,"Li Yi",'F',60,80,100};

^~~~~~~~~

{ }

source.c:5:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]

main(){void print(struct teacher *);print(&tec);system("pause");}

^~~~

source.c:6:60: warning: format specifies type 'char *' but the argument has type 'char' [-Wformat]

void print(struct teacher *p){printf(FORMAT,p->num,p->name,p->sex,p->score[0],p->score[1],p->score[2]);printf("\n"); }

^~~~~~

source.c:6:119: warning: no newline at end of file [-Wnewline-eof]

void print(struct teacher *p){printf(FORMAT,p->num,p->name,p->sex,p->score[0],p->score[1],p->score[2]);printf("\n"); }

^

4 warnings generated.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值