c语言 a.next=&b;b.next=&c;c.next=NULL;为什么不可以换成&a->next=&b;&b->next=&c;&c->next=null;#includestruct node{char ad;struct node *next;};typedef struct node A;main(){A a,b,c,*ac,*bc;a.ad='a';b.ad='b';c.ad='c';ac=&a;a.next=&b;b.next=&c;c.
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/25 10:19:11
c语言 a.next=&b;b.next=&c;c.next=NULL;为什么不可以换成&a->next=&b;&b->next=&c;&c->next=null;#includestruct node{char ad;struct node *next;};typedef struct node A;main(){A a,b,c,*ac,*bc;a.ad='a';b.ad='b';c.ad='c';ac=&a;a.next=&b;b.next=&c;c.
c语言 a.next=&b;b.next=&c;c.next=NULL;为什么不可以换成&a->next=&b;&b->next=&c;&c->next=null;
#include
struct node
{char ad;
struct node *next;
};
typedef struct node A;
main()
{A a,b,c,*ac,*bc;
a.ad='a';b.ad='b';c.ad='c';ac=&a;
a.next=&b;b.next=&c;c.next=NULL;
bc=ac;
while(bc)
{printf("%c",bc->ad);
bc=bc->next;
}
printf("\n");
}
c语言 a.next=&b;b.next=&c;c.next=NULL;为什么不可以换成&a->next=&b;&b->next=&c;&c->next=null;#includestruct node{char ad;struct node *next;};typedef struct node A;main(){A a,b,c,*ac,*bc;a.ad='a';b.ad='b';c.ad='c';ac=&a;a.next=&b;b.next=&c;c.
->的优先级比&的高.如果你要用->的话应该这么写:(&a)->next=&b