代码如下:
#include<stdio.h>
#include<string.h>
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);
}