工大后院

 找回密码
 加入后院

扫一扫,访问微社区

QQ登录

只需一步,快速开始

搜索
查看: 1303|回复: 1

学过c语言的大虾帮帮忙咯

[复制链接]
发表于 2005-5-30 16:24 | 显示全部楼层 |阅读模式
语法错误。。

stu[N]是一个结构体数组,在printf里却没有数组下标。
主函数里调用print时参数用数组名就行了。

void print(struct student stu[])
{int i;
for(i=0;i<N;i++)
  {printf(FORMAT,stu.num,stu.name,stu.sex,stu.age,
        stu.score[0],stu.score[1],stu.score[2]); //modify here stu. change to stu.
   printf("\n");}
}
main()
{clrscr();
print(stu); //modify here stu[] change to stu
}

[ Last edited by hjack on 2005-5-30 at 16:31 ]
 楼主| 发表于 2005-6-2 23:06 | 显示全部楼层
多谢hjack的支点哦
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 加入后院

本版积分规则

QQ|Archiver|手机版|小黑屋|广告业务Q|工大后院 ( 粤ICP备10013660号 )

GMT+8, 2025-5-13 15:19

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回复 返回顶部 返回列表