aboutsummaryrefslogtreecommitdiff
path: root/Project1
diff options
context:
space:
mode:
authorConnor McDowell <[email protected]>2024-02-11 18:56:57 -0800
committerConnor McDowell <[email protected]>2024-02-11 18:56:57 -0800
commit05e5747335f8c776274dccfb95603662e315f7a3 (patch)
tree1abe77fd5d3b98184cbd52e1470c0eb4ca0b66a7 /Project1
parenttesting ins, struct manipulation and list manipulation (diff)
downloadhomework-5-connormcdowell275-05e5747335f8c776274dccfb95603662e315f7a3.tar.xz
homework-5-connormcdowell275-05e5747335f8c776274dccfb95603662e315f7a3.zip
currently what im working with
Diffstat (limited to 'Project1')
-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;