Question: home / study / engineering / computer science / computer science questions and answers / dynamic string array c++ program: for this project, use pointer

home / study / engineering / computer science / computer science questions and answers / dynamic string array c++ program: for this project, use pointer notation rather than array ...

Question: Dynamic String Array C++ PROGRAM: For this project, use pointer notation rather than array notati...

Dynamic String Array

C++ PROGRAM: For this project, use pointer notation rather than array notation rather than array notation. For example, use *(ptr + i) instead of ptr[i] where ptr is a pointer to a string.

The logic similar to what the vector C++ object uses.

In main, create a loop that asks for a user choice and prints the following menu:

Please choose from the following menu choices 1) Insert a new element to the end of the list. 2) Insert a new element at the beginning of the list. 3) Insert an element into the list at a given index. 4) Remove an element from the end of the list. 5) Remove an element from the list at a given index. 6) Sort the list. 7) Print the contents of the list. 8) Exit.

Implement each option in the menu. Use the following function prototypes for your design:

void printMenu(); void printList(string *p, int size); string *expand(string *p, int &size); bool insertAtZero(string *p, string item, int count); bool insertAt(string *p, string item, int index, int count); bool insertAtEnd(string *p, string item, int count); bool removeFromEnd(string *p, int count); bool removeFrom(string *p, int index, int count); void sort(string *p, int count);

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!