diff options
| author | Connor McDowell <[email protected]> | 2024-02-17 21:12:06 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-02-17 21:12:06 -0800 |
| commit | 23ba129b0fcf42992cd92aab1db94b3c0ae34604 (patch) | |
| tree | 13312283c2b71f4d658cee0ac26f686fea448c37 | |
| parent | me when possible thing just visstudio prob (diff) | |
| download | homework-5-connormcdowell275-23ba129b0fcf42992cd92aab1db94b3c0ae34604.tar.xz homework-5-connormcdowell275-23ba129b0fcf42992cd92aab1db94b3c0ae34604.zip | |
just missing clean up and syntax fix
| -rw-r--r-- | Project1/Contacts.h | 4 | ||||
| -rw-r--r-- | Project1/contacts.cpp | 29 | ||||
| -rw-r--r-- | Project1/program.cpp | 4 |
3 files changed, 16 insertions, 21 deletions
diff --git a/Project1/Contacts.h b/Project1/Contacts.h index b9e6dd7..df5416e 100644 --- a/Project1/Contacts.h +++ b/Project1/Contacts.h @@ -23,8 +23,8 @@ char addNew(contact* newContact[]); void update(contact* newContact[]); -void printAll(); +void printAll(contact* newContact[]); + -void exit(); #endif CONTACTS_HEADER_H
\ No newline at end of file diff --git a/Project1/contacts.cpp b/Project1/contacts.cpp index 2a54516..9a3f44a 100644 --- a/Project1/contacts.cpp +++ b/Project1/contacts.cpp @@ -75,20 +75,15 @@ void update(contact* newContact[]) } } - -//struct contact_list -//{ -// contact contact[MAX_CONTACTS]; -// int count; -//}; - -//int contacts_insert_new(contact_list contacts, contact newContact) -//{ -// memcpy(&contacts->contact[contacts->count++], newContact); -// -//} - -// 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 -// add: print all contacts.
\ No newline at end of file +void printAll(contact* newContact[]) +{ + for (int i = 0; i < newContact[i]->id; ++i) + { + cout << "name: " << newContact[i]->Name << endl; + cout << "Email: " << newContact[i]->Email << endl; + cout << "Address: " << newContact[i]->StreetAddress << endl; + cout << "city" << newContact[i]->City << endl; + cout << "state: " << newContact[i]->State << endl; + cout << "Zip: " << newContact[i]->Zip << endl; + } +} diff --git a/Project1/program.cpp b/Project1/program.cpp index 8edbaf7..c97ba49 100644 --- a/Project1/program.cpp +++ b/Project1/program.cpp @@ -41,11 +41,11 @@ int main() } if (c == 3) { - printAll(); + printAll(&newContact[]); } if (c == 4) { - exit(); + O = 0; } } }
\ No newline at end of file |