Linked list of struct

This is a discussion on Linked list of struct within the C Programming forums, part of the General Programming Boards category; I can't get my code to run right at all. This is C programming. I need to also figure out ...

Linked list of struct

I can't get my code to run right at all. This is C programming. I need to also figure out where to plug in to prompt user for words and make it store them. Help please. This is the assignment guidelines:Write a program that will do the following:Continuously prompt the user for words and store the words in a linked list, keeping the words in alphabetical order. Do not use an array to store the words or in any way pre-allocate any memory. You can, and should, use an array when initially reading the word from the user. Use malloc() to request memory for each word after it is read and then store the node into the linked list in its proper location.Use a function GetWord to read a single word from the user.As each word is entered into the list, print the contents of the list using a function PrintList. If the list is empty the function should print “List is empty”. The output of the PrintList function should be on the right side of the screen as shown on the sample output.When the user indicates that there are no more words to enter, print the final contents of the list.Then delete the last node in the list repeatedly, until the list is empty, calling the PrintList function after each word is removed from the list.Your program should allow for the possible storage of any number of words. Each word should allow a maximum size of 15 letters. Your program should make certain that this word length is not exceeded so that the program does not crash if longer words are entered by the user. If a longer word is entered it should be discarded.A sample run is shown below. Your data entry prompts should be on the left side of the screen as shown. Your output should look EXACTLY like the example, except for the actual words entered.
Sample Run
List is empty
Enter a word: four
four

Do you have more words? yes or no: y
Enter a word: score
four
score

Do you have more words? yes or no: y
Enter a word: and
and
four
score

Do you have more words? yes or no: y
Enter a word: seven
and
four
score
seven

Do you have more words? yes or no: y
Enter a word: years
and
four
score
seven
years

Do you have more words? yes or no: y
Enter a word: ago
ago
and
four
score
seven
years

Do you have more words? yes or no: n
Final list is:
ago
and
four
score
seven
years

Anyway, C is a very ordered language; it has to know about things before you can go about using them. You have a parameter type of `node' before telling the compiler that `node' is a thing. Start with fixing that and see what happens next.