diff options
| author | Connor McDowell <[email protected]> | 2024-03-08 12:36:58 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-03-08 12:36:58 -0800 |
| commit | 0da86e742fa41643aff752c1f434cb191036463a (patch) | |
| tree | cdbdcc91d900921829fd7a9dcdb48121b21c2c1f /Project1/program.cpp | |
| parent | proper char outputs. however each added contact is overwriting (saved to same... (diff) | |
| download | homework-7-connormcdowell275-0da86e742fa41643aff752c1f434cb191036463a.tar.xz homework-7-connormcdowell275-0da86e742fa41643aff752c1f434cb191036463a.zip | |
refactored with strings instead of char arrays
Diffstat (limited to 'Project1/program.cpp')
| -rw-r--r-- | Project1/program.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Project1/program.cpp b/Project1/program.cpp index c7a776f..4d4d6f6 100644 --- a/Project1/program.cpp +++ b/Project1/program.cpp @@ -5,6 +5,8 @@ #include "Contact_list.h" #include <iostream> +#include <string.h> +#include <stdio.h> using std::cin; using std::cout; @@ -24,7 +26,7 @@ int main() size_t t = 0; contacts.set_size(MAX); - cout << contacts.get_size() << endl; + //cout << contacts.get_size() << endl; while (O == 1) { contact_struct save_contacts; @@ -32,7 +34,7 @@ int main() // c = choice input int c = 0; cout << "1. Enter a contact\n"; - cout << "2. Update a contact\n"; + cout << "2. Copy all contacts\n"; cout << "3. print all contacts\n"; cout << "4. Delete a contact\n"; cout << "5. Quit\n"; @@ -42,7 +44,7 @@ int main() { case 1: //addNew(newContact, MAX, t); - contacts.AddContact(newContact, t, save_contacts); + contacts.AddContact(newContact, t, save_contacts, contacts); //addContact(newContact, contacts.get_size(), contacts[MAX]); //for (auto i = 0u; i < MAX; ++i) //{ @@ -91,7 +93,8 @@ int main() break; case 2: //contacts.Update(newContact); - cout << "this program is currently a work in progress" << endl; + //cout << "this program is currently a work in progress" << endl; + contacts.CopyList(newContact, contacts.get_size()); break; case 3: contacts.Print(); // Print only the existing contacts |