diff options
| author | Connor McDowell <[email protected]> | 2024-02-17 20:21:37 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-02-17 20:21:37 -0800 |
| commit | 12ac77df4d844cb760db95ec65b9ed99d6bfeb7f (patch) | |
| tree | 11c9d88d5bb54f31b7cb6dd6cad71fb82acd39c0 /Project1/contacts.cpp | |
| parent | finally getting into the groove of this assignment (diff) | |
| download | homework-5-connormcdowell275-12ac77df4d844cb760db95ec65b9ed99d6bfeb7f.tar.xz homework-5-connormcdowell275-12ac77df4d844cb760db95ec65b9ed99d6bfeb7f.zip | |
honk shoo
Diffstat (limited to 'Project1/contacts.cpp')
| -rw-r--r-- | Project1/contacts.cpp | 60 |
1 files changed, 26 insertions, 34 deletions
diff --git a/Project1/contacts.cpp b/Project1/contacts.cpp index f932281..d738b31 100644 --- a/Project1/contacts.cpp +++ b/Project1/contacts.cpp @@ -24,7 +24,7 @@ int menu() return c; } -char addNew(contact newContact) +char addNew(contact* newContact[]) { int i = 0; @@ -35,17 +35,35 @@ char addNew(contact newContact) cout << "works!" << endl; for (int i = 0; i < 10; i++) { - cin >> newContact[i].Name; - cin >> newContact[i].Email; - cin >> newContact[i].StreetAddress; - cin >> newContact[i].City; - cin >> newContact[i].State; - cin >> newContact[i].Zip; + newContact[i]->id = i + 1; + cin >> newContact[i]->Name; + cin >> newContact[i]->Email; + cin >> newContact[i]->StreetAddress; + cin >> newContact[i]->City; + cin >> newContact[i]->State; + cin >> newContact[i]->Zip; break; } - cout << newContact[i].Name << "\n" << newContact[i].Email << "\n" << newContact[i].StreetAddress << "\n" << newContact[i].City << "\n" << newContact[i].State << "\n" << newContact[i].Zip << endl; + cout << newContact[i]->Name << "\n" << newContact[i]->Email << "\n" << newContact[i]->StreetAddress << "\n" << newContact[i]->City << "\n" << newContact[i]->State << "\n" << newContact[i]->Zip << endl; } } +// print contact i +// name: +// email +// address +// city +// state +// zip + +void update(contact newContact[]) +{ + int i = 0; + cin >> i; + i - 1; + newContact[i].id; + + +} //struct contact_list @@ -60,32 +78,6 @@ char addNew(contact newContact) // //} -//char addNew() -//{ -// contact newContact; -// cin >> newContact.Name; -// cout << newContact.Name << endl; -// cin >> newContact.Email; -// cout << newContact.Email << endl; -// cin >> newContact.StreetAddress; -// cout << newContact.StreetAddress << endl; -// cin >> newContact.City; -// cout << newContact.City << endl; -// cin >> newContact.State; -// cout << newContact.State << endl; -// cin >> newContact.Zip; -// cout << newContact.Zip << endl; -// -// -// -// return 0; -//} - -//for (auto const& i : name) -//{ -// cout << i << endl; -//} - // add: prompt add, get cin for contact.name contact.email contact.address contact.city and contact.zip // add update: find struct through name value (if contact.name == i = cin pull up that struct and do similar // to add) and save over it |