diff options
Diffstat (limited to 'Project1/contacts.cpp')
| -rw-r--r-- | Project1/contacts.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Project1/contacts.cpp b/Project1/contacts.cpp index 7db5b25..2e95c97 100644 --- a/Project1/contacts.cpp +++ b/Project1/contacts.cpp @@ -114,9 +114,11 @@ void printAll(contact newContact[], size_t MAX) void contact_double(contact*& newContact, size_t& MAX, size_t t) { + //supposedly doubles length. doesnt work. + //current ideas: add if loop to whole main with the id counter t and if length of newContact = max double the length. + //current problems: using const size_t max prevents editing size for the whole function, and it resets as soon as the while loop loops or leaves the scope of the if statement. contact* doubleContact = new contact[MAX * 2]; - size_t a = 0; - for (a = t, a < MAX * 2; ++a;) + for (auto a = 0u; a < MAX * 2; ++a) { doubleContact[a] = newContact[a]; } @@ -124,4 +126,11 @@ void contact_double(contact*& newContact, size_t& MAX, size_t t) newContact = doubleContact; MAX = MAX * 2; //return newContact[MAX]; +} + +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 + //add to new part to addNew: if bool != 0 then copy and paste update code w/addNew couts }
\ No newline at end of file |