diff options
| -rw-r--r-- | num2.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -130,7 +130,9 @@ void RmString(string arr[], int limit) // May need to use vector. int i = 0, j = 0, k = 0; int choice; + string deleted; string copy[max]; + cout << "What data entry would you like to delete..." << endl; PrintString(limit, arr); cout << "Please enter the number for the string that you'd like to delte: " << endl; @@ -142,28 +144,28 @@ void RmString(string arr[], int limit) { if (k == choice) { cout << "Deleting...\n\n" << endl; + deleted = arr[k]; k++; + j--; + } else { copy[j] = arr[k]; k++; } - - } - cout << "==================================================================\n"; cout << "Here is our updated database..." << endl; cout << "==================================================================\n"; - while (i < limit) + while (i < (limit - 1)) { cout << i+1 << ") " << copy[i] << endl; i++; } - + cout << "We removed: " << deleted << endl; } |