1,105,456 Community Members

Answer as soon as possibe please; Linked list: I've a small question

Member Avatar
MRehanQadri
Junior Poster in Training
55 posts since Feb 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

If the prototype of my function is void sell_item(store **head,store **tail). In main i've passed sell_item(&head,&tail), where head & tail where both pointers of store(struct) type.

Now I want to access the the content where head is pointing to. How shall I access it? Like *head->next??? But this is not working.
where next is another member of store storing pointing to the next location of memory (pointing to next node).

Member Avatar
Moschops
Nearly a Posting Virtuoso
1,383 posts since Sep 2008
Reputation Points: 414 [?]
Q&As Helped to Solve: 269 [?]
Skill Endorsements: 16 [?]
Featured
 
1
 

head is a pointer to a pointer to a store.

So *head is a pointer to a store.

So *(*head) is a store.

So (*(*head)).next is the member variable next of the store.

Member Avatar
MRehanQadri
Junior Poster in Training
55 posts since Feb 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks dude.

Question Answered as of 1 Year Ago by Moschops
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article