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

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.

2
Contributors
1
Reply
28 Minutes
Discussion Span
7 Months Ago
Last Updated
2
Views
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
Team Colleague
32,270 posts since Aug 2005
Reputation Points: 5,852
Solved Threads: 2,590
Skill Endorsements: 70

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0566 seconds using 2.72MB