From fae782e95a133affd899bf3160b1a4d5e86d5965 Mon Sep 17 00:00:00 2001 From: Connor McDowell Date: Wed, 21 Feb 2024 13:28:59 -0800 Subject: comments added. attempting new try to get doubling to work. --- Project1/contacts.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Project1/contacts.cpp') 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 -- cgit v1.2.3