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);
}
그것은 = {10, & B}에서 오류를 보이고 발현 syntex의 error.please 도움 .. 미리 thankzz오류 : 예상되는 표현 앞에 '{'토큰 |
compound literal를 사용하는
을 그렇지 않으면, 당신은 한 사용 -a-struct-in-ansi-c는 다른 훌륭한 대답을 제공합니다. –
이 언어는'- *'연산자를 제공하므로'(* s) .next'보다는's-> next'라고 말할 수 있습니다. – AAT