aboutsummaryrefslogtreecommitdiff
path: root/Project1/contacts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Project1/contacts.cpp')
-rw-r--r--Project1/contacts.cpp60
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