Home > Back-end >  The linked list data structure
The linked list data structure

Time:09-28

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 ~

Can be transmitted to double pointer

CodePudding user response:

reference 1/f, confident boy reply:
the original poster in C compiler, & amp; As a parameter, is the c + + support grammar ~

Can pass the double pointer ~

I am using PTA platform, zhejiang university, I learn pure c language, that is I can't write (& amp; L) such a statement? When written in devc if can pass

CodePudding user response:

refer to the second floor Excel_lent response:
Quote: reference 1/f, confident boy reply:

The original poster in C compiler, & amp; As a parameter, is the c + + support grammar ~

Can pass the double pointer ~

I am using PTA platform, zhejiang university, I learn pure c language, that is I can't write (& amp; L) such a statement? Written in devc like can through

& Is a c + + syntax ~ if you don't through compilation, then use double pointer

CodePudding user response:

reference 3 building self-confidence boy reply:
Quote: refer to the second floor Excel_lent response:

Quote: 1 reference building self-confidence boy reply:

The original poster in C compiler, & amp; As a parameter, is the c + + support grammar ~

Can pass the double pointer ~

I am using PTA platform, zhejiang university, I learn pure c language, that is I can't write (& amp; L) such a statement? Written in devc like can through

& Is a c + + syntax ~ if you don't through compilation, then use double pointer

LinkList Read () is the function type is LinkList type, structure pointer type? We don't have to learn C language is relatively advanced knowledge, look up the data structure is a bit hard
  • Related