求用C语言怎么实现学生信息录入功能

如题,用C语言实现学生信息录入功能(学生信息用文件保存),学生信息包括:学号,姓名,年龄,性别,出生年月,地址,邮箱。求大神指教,感激不尽!没分,只有10分...好人一生平安
我要输入N个学生信息,然后这个N可以由用户自己设定,要怎么做才能实现?我只负责输入,求大神给详细解答和程序,谢谢!

* 1。根据学生信息定义一个结构体类型,再说明一个该结构体类型的数组。*/
struct stu_info{
char stuNo[10];/* No */
char stuName[30];/* Name */
float stuScore[3];/* the three scores */
float aveScore; /* average score */
float totalScore; /* total score */
}stu[10];
/* 2。用input函数从键盘上输入10个学生的数据。 */
void input()
{ int i = 0;
printf("Input the students' infomation(FORMAT LIKE:No Name score1 score2 score3):\n");
while(i < 10)
{ printf("Input %d:",i + 1);
scanf("%s%s%f%f%f",stu[i].stuNo,stu[i].stuName,&stu[i].stuScore[0],&stu[i].stuScore[1],&stu[i].stuScore[2]);
i++;
}
}追问

如果我要输入100个学生的信息要怎么做?

追答

使用malloc函数,
要包含头文件 #include

追问

额 看不懂... 您能打出来吗?我想输入的是N个学生,然后这个N可以由用户设定的那种,要怎么做?

温馨提示:答案为网友推荐,仅供参考
相似回答