In C, WITH NODES Nodes should contain a C-style string as the main data value • You should have the following files (nam
Posted: Fri Apr 29, 2022 6:54 am
In C, WITH NODES
Nodes should contain a C-style string as the main data
value
• You should have the following files (named as follows):
• driver.c which is your driver file
• Node.h which contains your struct definition
• LinkedList.h which contains your header file for your linked list
implementation and contains
methods void printList(struct node *) and struct node*
makeList(void)
• LinkedList.c which contains your implementation for your linked
list class
• The user should be prompted with “Enter a word or phrase, or -99
to end: ”
• You should make sure to correctly allocate and deallocate
memory.
• Once -99 is entered, the program should state:
o You’ve entered the following nodes: word1, word2, word3, ..., and
wordx.
struct node {
char data;
struct node* next;
} *head;
Sample output:
Enter a word or phrase, or -99 to end: Hello World
Enter a word or phrase, or -99 to end: Goodbye World
Enter a word or phrase, or -99 to end: -99
You've entered the following nodes: Hello World and Goodbye
World
Enter a word or phrase, or -99 to end: Hello World
Enter a word or phrase, or -99 to end: Fridays
Enter a word or phrase, or -99 to end: are the best weekdays
Enter a word or phrase, or -99 to end: -99
You've entered the following nodes: Hello World, Fridays, and are
the best weekdays
Enter a word or phrase, or -99 to end: Hey!
Enter a word or phrase, or -99 to end: -99
You've entered the following nodes: Hey!
Nodes should contain a C-style string as the main data
value
• You should have the following files (named as follows):
• driver.c which is your driver file
• Node.h which contains your struct definition
• LinkedList.h which contains your header file for your linked list
implementation and contains
methods void printList(struct node *) and struct node*
makeList(void)
• LinkedList.c which contains your implementation for your linked
list class
• The user should be prompted with “Enter a word or phrase, or -99
to end: ”
• You should make sure to correctly allocate and deallocate
memory.
• Once -99 is entered, the program should state:
o You’ve entered the following nodes: word1, word2, word3, ..., and
wordx.
struct node {
char data;
struct node* next;
} *head;
Sample output:
Enter a word or phrase, or -99 to end: Hello World
Enter a word or phrase, or -99 to end: Goodbye World
Enter a word or phrase, or -99 to end: -99
You've entered the following nodes: Hello World and Goodbye
World
Enter a word or phrase, or -99 to end: Hello World
Enter a word or phrase, or -99 to end: Fridays
Enter a word or phrase, or -99 to end: are the best weekdays
Enter a word or phrase, or -99 to end: -99
You've entered the following nodes: Hello World, Fridays, and are
the best weekdays
Enter a word or phrase, or -99 to end: Hey!
Enter a word or phrase, or -99 to end: -99
You've entered the following nodes: Hey!