diff options
| author | Connor McDowell <[email protected]> | 2024-03-07 13:07:49 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-03-07 13:07:49 -0800 |
| commit | 47cbdd02b22b832175e77f03846845d188701bba (patch) | |
| tree | 12f8673347c42a199da20fc346929505f3276931 /Project1/program.cpp | |
| parent | starting work (diff) | |
| download | homework-7-connormcdowell275-47cbdd02b22b832175e77f03846845d188701bba.tar.xz homework-7-connormcdowell275-47cbdd02b22b832175e77f03846845d188701bba.zip | |
proper char outputs. however each added contact is overwriting (saved to same point in memory)
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: |