这是代码
#include<stdio.h>
#define NULL 0
struct student
{long num;
int score;
struct student *next;
};
void main()
{struct student a,b,c,*head,*p;
a.num=10101;a.score=89.5;
b.num=10103;b.score=90;
c.num=10107;b.score=85;
head=&a;
a.next=&b;
b.next=&c;
c.next=NULL;
p=head;
while(p!=NULL)
{printf("%ld %5.1f\n",p->num,p->score);
p=p->next;
}}
代码用vc++6.0组建的时候没错但是运行的时候出现这个
#include<stdio.h>
#define NULL 0
struct student
{long num;
int score;
struct student *next;
};
void main()
{struct student a,b,c,*head,*p;
a.num=10101;a.score=89.5;
b.num=10103;b.score=90;
c.num=10107;b.score=85;
head=&a;
a.next=&b;
b.next=&c;
c.next=NULL;
p=head;
while(p!=NULL)
{printf("%ld %5.1f\n",p->num,p->score);
p=p->next;
}}
代码用vc++6.0组建的时候没错但是运行的时候出现这个