Question: C++ LINEAR LINK LIST You will create a main.h and a main.cpp file for this Lab. In the main.h file include the following struct declaration

C++ LINEAR LINK LIST

You will create a main.h and a main.cpp file for this Lab. In the main.h file include the following struct declaration

C++ LINEAR LINK LIST You will create a main.h and a main.cpp

for the element struct. This is your linked list element.

Your main.cpp program will store all of its command line arguments (the elements in the argv array) in a linked list of element. Your program will need a list head pointer: element * head; that points to the first element of the list. All elements in the list should be dynamic variables created by a new command.

  1. For each command line argument:
    1. Store the command line argument in a new element variable
    2. Append the element to the end of the linked list
  2. After loading the list, display the contents of the list
  3. Prompt the user for a word to delete from the list
  4. Remove the word from the linked list.
  5. Display (again) the list - the target word should no longer be in the list

Your program must avoid any memory leaks - be sure to delete anything you created before the program ends! Here is an example of how your program should behave:

file for this Lab. In the main.h file include the following struct

// Element struct struct element std::string word; *next // Word to save // Next pointer element syccuxas01> main this is a test of lab 5 ord "main" ord "this" ord "is" Nord "a" = ord "test" ord"of" ord "1ab" Word - "5" Enter word to delete: main "main" deleted from the 1ist: ord "this" ord "is" Nord "a" = ord "test" Nord "of" = Nord = "lab" ord"5

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!