LinkList Read () {/* Read the list elements, on one end of the symbol */ LinkList L, rear, temp. ElemType data; L=(LNode *) malloc (sizeof (LNode));/* */head empty nodes L - & gt; Data=https://bbs.csdn.net/topics/-1; L - & gt; Next=NULL; Rear=L; The scanf (" % d ", & amp; The data); While (data!=1) { Temp=(LNode *) malloc (sizeof (LNode)); Temp - & gt; Data=https://bbs.csdn.net/topics/data; Write://printf (" % d \ n ", temp - & gt; The Data); Temp - & gt; Next=NULL; Rear - & gt; Next=temp; Rear=rear - & gt; Next; The scanf (" % d ", & amp; The data); } return L;/* return to take the lead in empty node list */ }
Void the Read (LinkList & amp; L) {/* read the list elements, on one end of the symbol */ LinkList rear, temp; ElemType data; L=(LNode *) malloc (sizeof (LNode));/* */head empty nodes L - & gt; Data=https://bbs.csdn.net/topics/-1; L - & gt; Next=NULL; Rear=L; The scanf (" % d ", & amp; The data); While (data!=1) { Temp=(LNode *) malloc (sizeof (LNode)); Temp - & gt; Data=https://bbs.csdn.net/topics/data; Write://printf (" % d \ n ", temp - & gt; The Data); Temp - & gt; Next=NULL; Rear - & gt; Next=temp; Rear=rear - & gt; Next; The scanf (" % d ", & amp; The data); }
} Why the second method compiler display function transfer & amp; L error
CodePudding user response:
The original poster in C compiler, & amp; As a parameter, is the c + + support grammar ~