array of pointers to linked lists
How would i go about declaring an array that has pointer to linked lists? i need to create an array that has 28 elements(28 letters of the English alphabet) of char type and each of them should be a pointer to a linked list that will store words. i am making a dictionary. i have a good understanding of array and pointers but not that much on linked lists.
28 Minutes
Discussion Span
Related Article: Problem with linked lists and templates
is a C++ discussion thread by laura90 that has 5 replies, was last updated 11 months ago and has been tagged with the keywords: linked, lists, templates.
liphoso
Junior Poster in Training
58 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Each node in a linked list is actually a pointer to a node object, in your case a node is a structure that contains words and a pointer to another node. So to create an array of pointers to the nodes, create the array of pointers, then use a loop to set each pointer to one of the nodes.
Practice a little creating simple linked lists and all the above will become clear.
Ancient Dragon
Achieved Level 70
32,270 posts since Aug 2005
Reputation Points: 5,852
Solved Threads: 2,590
Skill Endorsements: 70