Question
Consider the following C++ program: #include #include #include #define SIZE 50 void insert_name(char **list, char *name, int *size); void print_list(char **list, int size); void save_list(FILE
Consider the following C++ program:
#include
#define SIZE 50
void insert_name(char **list, char *name, int *size); void print_list(char **list, int size); void save_list(FILE *fp, char **list, int size);
int main(){ FILE *fp; char *name[SIZE]; char temp[30]; int size = 0, choice = 0; do{ printf("MENU: 1: To insert a name "); printf("2: To print all names in the list "); printf("3: Load a list "); printf("4: Save the list "); printf("5: Exit Program "); printf("Your choice: "); scanf("%d",&choice); if (choice == 1) { if (size 1. The insert_name function will insert a new string into the list. Write the insert_name function with the malloc function. 2. Write the print_list function which will print every item on the list onto the console. 3. Write the save_list function that is called in choice 4. This function will save the list into the text file that has been opened in the supplied code above.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started