Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

image text in transcribed

#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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

5. Discuss the role of the Web in career management.

Answered: 1 week ago