aboutsummaryrefslogtreecommitdiff
path: root/Project1/contacts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Project1/contacts.cpp')
-rw-r--r--Project1/contacts.cpp53
1 files changed, 31 insertions, 22 deletions
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 <iostream>
#include <list>
-#
+#include <vector>
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<char> myList(i, t);
-
-
+ int i = 0;
+ std::list<contact> 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;