diff options
Diffstat (limited to 'Project1/program.cpp')
| -rw-r--r-- | Project1/program.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Project1/program.cpp b/Project1/program.cpp index ab71dce..c7a776f 100644 --- a/Project1/program.cpp +++ b/Project1/program.cpp @@ -17,8 +17,8 @@ int main() size_t MAX = 3; int O = 1; /* t = index counter*/ - contact newContact; - //contact* newContact = new contact[MAX]; + //contact newContact; + contact* newContact = new contact[MAX]; contact_list contacts(MAX); size_t t = 0; @@ -27,6 +27,7 @@ int main() cout << contacts.get_size() << endl; while (O == 1) { + contact_struct save_contacts; //cout << MAX << endl; // c = choice input int c = 0; @@ -41,7 +42,7 @@ int main() { case 1: //addNew(newContact, MAX, t); - contacts.AddContact(newContact, t); + contacts.AddContact(newContact, t, save_contacts); //addContact(newContact, contacts.get_size(), contacts[MAX]); //for (auto i = 0u; i < MAX; ++i) //{ @@ -85,6 +86,7 @@ int main() // contacts.AddContact(newContact); // break; //} + t++; break; case 2: @@ -95,7 +97,7 @@ int main() contacts.Print(); // Print only the existing contacts break; case 4: - contacts.DeleteContact(newContact); + contacts.DeleteContact(&newContact); //contacts.CopyList(&newContact, MAX); break; case 5: |