关于结构体输入问题。刚运行程序就直接结束了,本人比较小白,见谅啦~~
#include<stdio.h>struct student
{
int num;
double mark;
} stu[3];
struct student *p=stu;
int main()
{
int write(struct student *p);
int read(struct student *p);
}
int write(struct student *p)
{
int j=0;
for(;p<stu+3,j<3;p++,j++)
scanf("%d %lf",&p->num,&p->mark);
}
int read(struct student *p)
{
for(p=stu;p<3+stu;p++)
printf("%d %lf\n",p->num,p->mark);
}