aboutsummaryrefslogtreecommitdiff
path: root/Project1/contacts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Project1/contacts.cpp')
-rw-r--r--Project1/contacts.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/Project1/contacts.cpp b/Project1/contacts.cpp
index 2e95c97..79f048c 100644
--- a/Project1/contacts.cpp
+++ b/Project1/contacts.cpp
@@ -7,23 +7,19 @@ using std::cin;
using std::cout;
using std::endl;
-int menu()
-{
- int c;
-
- cout << "1. Enter a name\n";
- cout << "2. Delete a name\n";
- cout << "3. List the file\n";
- cout << "4. Quit\n";
- do {
- cout <<"\nEnter your choice: ";
- cin >> c;
- } while (c < 0 || c>4);
- return c;
-}
+
char addNew(contact newContact[], size_t MAX, size_t t)
{
+ //using couts to prompt using for all parts of newContact struct.
+ //update plans: check for newContact[i].bool value, if false, use a modified void update
+ //(new function thats just void update with different couts) to be called with an if statement.
+ //or another for.
+ //for (size_t i = 0; i < max/length; i++)
+ //if (bool == false)
+ // void mod_update
+ // to check for any "empty"/deleted contacts before adding one. if bool == false should include break after mod_update.
+ //CURRENTLY WORKS
for (size_t i = t ; i < MAX; i++)
{
newContact[i].id = i+1;
@@ -59,6 +55,8 @@ char addNew(contact newContact[], size_t MAX, size_t t)
void update(contact newContact[], size_t MAX)
{
+ //uses input based on list number from print (though when delete is made will be using that id/name print) to update the values of.
+ //CURRENTLY WORKING
cout << "select a contact to update based on their position in the list (check print all contacts for list position)" << endl;
int c = 0;
cin >> c;
@@ -87,6 +85,8 @@ void update(contact newContact[], size_t MAX)
void printAll(contact newContact[], size_t MAX)
{
+ //prints all info but count and bool for every existing (non trash value filled) contact struct
+ //CURRENTLY WORKING
for (int i = 0; i < MAX; ++i)
{
/*for (int t = -1; t < newContact[i].id;) {
@@ -130,7 +130,7 @@ void contact_double(contact*& newContact, size_t& MAX, size_t t)
void delete_contact(contact newContact[])
{
- //Work in progress, add BOOL (0) to struct, when this is selected print id list with respective names
- //then take input of id list number and set BOOL to 1
+ //Work in progress, add BOOL (true) to struct, when this is selected print id list with respective names
+ //then take input of id list number and set bool to false
//add to new part to addNew: if bool != 0 then copy and paste update code w/addNew couts
} \ No newline at end of file