【发布时间】:2015-03-28 23:03:17
【问题描述】:
struct node{
int data;
struct node *next;
};
main(){
struct node a,b,c,d;
struct node *s=&a;
a={10,&b};
b={10,&c};
c={10,&d};
d={10,NULL};
do{
printf("%d %d",(*s).data,(*s).next);
s=*s.next;
}while(*s.next!=NULL);
}
在 a={10,&b};Expression syntex error 处显示错误。请帮助.. 提前谢谢你
【问题讨论】:
-
查看stackoverflow.com/questions/330793/… 以获得其他出色的答案。
-
该语言提供
->运算符,因此您可以说s->next而不是(*s).next。
标签: c struct linked-list