We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,154 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

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

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).

2
Contributors
2
Replies
12 Minutes
Discussion Span
3 Months Ago
Last Updated
8
Views
Question
Answered
MRehanQadri
Junior Poster in Training
50 posts since Feb 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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.

Moschops
Practically a Posting Shark
889 posts since Sep 2008
Reputation Points: 297
Solved Threads: 170
Skill Endorsements: 5

Thanks dude.

MRehanQadri
Junior Poster in Training
50 posts since Feb 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 3 Months Ago by Moschops

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0611 seconds using 2.68MB