#include
struct Student
{
char name[10];
long id;
double math;
double english;
};
Student* creatAStudent(){
struct Student student;
//student = (student)malloc(sizeof(struct Student));
printf("请输入学生的名字\n");
scanf_s("%s", student.name);
printf("请输入学生的学号\n");
scanf_s("%d", student.id);
printf("请输入学生的数学成绩\n");
scanf_s("%d", student.math);
printf("请输入学生的英语成绩\n");
scanf_s("%d", student.english);
return &student;
}
void main(void){
struct Student *student = creatAStudent();
}
为什么程序不能正常运行?