From 05e5747335f8c776274dccfb95603662e315f7a3 Mon Sep 17 00:00:00 2001 From: Connor McDowell Date: Sun, 11 Feb 2024 18:56:57 -0800 Subject: currently what im working with --- Project1/contacts.cpp | 53 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 22 deletions(-) (limited to 'Project1') diff --git a/Project1/contacts.cpp b/Project1/contacts.cpp index d47aeba..bafd648 100644 --- a/Project1/contacts.cpp +++ b/Project1/contacts.cpp @@ -1,15 +1,18 @@ #include "Contacts.h" #include #include -# +#include using std::cin; using std::cout; using std::endl; using std::list; +using std::vector; + struct contact { + int id = 0; char Name[25] = {}; char Email[100] = {}; char StreetAddress[35] = {}; @@ -18,33 +21,39 @@ struct contact int Zip = 97034; }; -void myList() +contact myArrays(contact newContact) { - char t, s; - int i; - i = 100; - std::list myList(i, t); - - + int i = 0; + std::list myList(100, newContact); + for (auto i = 0; i < 100; i++) + { + newContact.id = i; + addNew(); + myList.push_back(newContact); + } + cout << newContact.id << endl; + return newContact; } char addNew() { // prompt user input w/o spaces - - 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; + + + + contact newContact[i]; + cin >> newContact[i].Name; + cout << newContact[i].Name << endl; + cin >> newContact[i].Email; + cout << newContact[i].Email << endl; + cin >> newContact[i].StreetAddress; + cout << newContact[i].StreetAddress << endl; + cin >> newContact[i].City; + cout << newContact[i].City << endl; + cin >> newContact[i].State; + cout << newContact[i].State << endl; + cin >> newContact[i].Zip; + cout << newContact[i].Zip << endl; -- cgit v1.2.3