I have following problem:
I have 2 structures: Clients and items
for example structure clients would have name and list of items from another structure asigned to this specific name I have to do this with singly linked lists. I simply have no idea how to do this would be great if somebody could explain to me how to do this and give example of how this should look aswell.
zaxo311
0
Light Poster
Recommended Answers
Jump to PostWere those two structures given to you or can you make them up yourself?
There are two linked lists -- Client and within each client node is a Items linked list.
To add a new client node you have to search the Client linked list to see if it is …
Jump to Postseems like normal linked list for me.
Yes -- what you want is just two nested normal linked lists.
Once you understand simple linked list it is just slightly more complicated to do nested linked lists. I would do it like this: The last function AddItem() shows how …
Jump to PostCould you explain me why in every function you use something like: struct item*
Yes, because that parameter is the head of the linked list to be used. How else do you think those functions are going to know where the top of the linked list is, and …
All 16 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
zaxo311
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
zaxo311
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
zaxo311
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
zaxo311
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
zaxo311
0
Light Poster
anas.man
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
zaxo311
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
zaxo311
0
Light Poster
zaxo311
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.