0x00AE18F8 处有未经处理的异常: 0xC0000005: 读取位置 0x00000020 时发生访问冲突。
这是我定义的struct DON_STUD_STR
{
long num;
char name[20];
float score;
int mark;
struct DON_STUD_STR * next;
};
这个函数为什么老是出错
struct DON_STUD_STR * DON_STUD_BRO(struct DON_STUD_STR *head)
{
struct DON_STUD_STR * p1;
p1 = (struct DON_STUD_STR *)malloc(sizeof(struct DON_STUD_STR));
p1 = head->next;
while (p1 != NULL)
{
printf("%-20s%-20s%-20s%-20s", "选好", /*"名字",*/ "成绩", "标记");
printf("%-20d\n", p1->num);
//printf("%-20d\n", p1->name);
printf("%-20f\n", p1->score);
printf("%-20d\n", p1->mark);
p1 = p1->next;
}
return(head);
}