代码没问题,但是没法运行,谁给看看
# include <stdio.h># include <malloc.h>
struct student
{
int data;
struct student *next;
} L;
int main ()
{
int i;
struct student *base,*top;
base=(struct student *) malloc (10 * sizeof (L));
top=base;
for (i=0;i<=9;i++)
{
top->data =i;
top=top->next;
}
while (top!=base)
{
printf ("%d",base->data);
base=base->next ;
}
return 0;
}