diff options
Diffstat (limited to 'Project1/program.cpp')
| -rw-r--r-- | Project1/program.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Project1/program.cpp b/Project1/program.cpp index 19ef0d2..0709b6c 100644 --- a/Project1/program.cpp +++ b/Project1/program.cpp @@ -15,27 +15,25 @@ constexpr size_t MAX = 3; int main() { int O = 1; + constexpr size_t MAX = 3; size_t Cont_list_lenth = 0; - contact* newContact = new contact[MAX]; + contact* newContact = new contact[3]; while (O == 1) { + cout << Cont_list_lenth << endl; int c = 0; cout << "1. Enter a contact\n"; cout << "2. Update a contact\n"; cout << "3. print all contacts\n"; cout << "4. Delete a contact\n"; - cout << "4. Quit\n"; + cout << "5. Quit\n"; cout << "\nEnter your choice: " << endl; cin >> c; //c = menu(); if (c == 1) { + Cont_list_lenth++; addNew(&newContact[Cont_list_lenth], MAX, Cont_list_lenth); - if (Cont_list_lenth >= MAX) - { - contact_double(newContact, MAX, Cont_list_lenth); - } - } if (c == 2) { @@ -43,7 +41,7 @@ int main() } if (c == 3) { - printAll(&newContact[Cont_list_lenth], MAX); + printAll(&newContact[Cont_list_lenth], MAX, Cont_list_lenth); } if (c == 4) { @@ -54,7 +52,6 @@ int main() delete[] newContact; return 0; } - ++Cont_list_lenth; - cout << Cont_list_lenth << endl; + } }
\ No newline at end of file |