aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Project1/Contacts.h4
-rw-r--r--Project1/contacts.cpp29
-rw-r--r--Project1/program.cpp4
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