diff options
| author | Connor McDowell <[email protected]> | 2024-02-21 13:28:59 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-02-21 13:28:59 -0800 |
| commit | fae782e95a133affd899bf3160b1a4d5e86d5965 (patch) | |
| tree | fba480a823b4088924c796b943b25f0e5379365d /Project1/program.cpp | |
| parent | still fuckin trying (diff) | |
| download | homework-6-connormcdowell275-fae782e95a133affd899bf3160b1a4d5e86d5965.tar.xz homework-6-connormcdowell275-fae782e95a133affd899bf3160b1a4d5e86d5965.zip | |
comments added. attempting new try to get doubling to work.
Diffstat (limited to 'Project1/program.cpp')
| -rw-r--r-- | Project1/program.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Project1/program.cpp b/Project1/program.cpp index 5dd1654..24a02ff 100644 --- a/Project1/program.cpp +++ b/Project1/program.cpp @@ -14,18 +14,18 @@ using std::endl; int main() { - size_t MAX = 3; int O = 1; - size_t t = 0; - contact* newContact = new contact[MAX]; while (O == 1) { + size_t MAX = 3; + size_t t = 0; + contact* newContact = new contact[MAX]; int c = 0; cout << "1. Enter a contact\n"; cout << "2. Update a contact\n"; cout << "3. print all contacts\n"; - cout << "3. Delete a contact\n"; - cout << "4. Quit\n"; + cout << "4. Delete a contact\n"; + cout << "5. Quit\n"; cout << "\nEnter your choice: " << endl; cin >> c; //c = menu(); @@ -42,6 +42,10 @@ int main() { printAll(&newContact[MAX], MAX); } + if (c == 4) + { + delete_contact(&newContact[MAX]); + } if (c == 5) { O = 0; |