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:

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

#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 *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.

#include #include #include fde fine SIZE 50 void insert name (char **list, charname, 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 size0, choice-0 printf ("MENU:nl: To insert a name n") printf ("2: To print all names in the list " printf ("3:Load a listIn") printf ("4:Save the listln") printf ("5: Exit Program "); printf ("Your choice: ") scanf ( "%d", & choice ) ; if (choice1) if (size

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!