// name: Connor McDowell // date: 2/19/2024 // class: CST116 // reason: homework number 6 #include "Contacts.h" #include using std::cin; using std::cout; using std::endl; //constexpr size_t MAX = 3; int main() { size_t MAX = 3; int O = 1; /* t = index counter*/ size_t t = 0; contact* newContact = new contact[MAX]; int length = sizeof(newContact[MAX]); cout << sizeof(newContact[MAX]) << endl; while (O == 1) { cout << MAX << endl; // c = choice input int c = 0; cout << "1. Enter a contact\n"; cout << "2. Update a contact\n"; cout << "3. print all contacts\n"; cout << "4. Delete a contact\n"; cout << "5. Quit\n"; cout << "\nEnter your choice: " << endl; cin >> c; if (t == MAX) { newContact[MAX] = contact_double(newContact, MAX, t); //MAX = max_double(MAX); } if (c == 1) { addNew(&newContact[MAX], MAX, t); //cout << t << endl; } if (c == 2) { update(&newContact[MAX], MAX); } if (c == 3) { printAll(&newContact[MAX], MAX); } if (c == 4) { delete_contact(&newContact[MAX]); } if (c == 5) { O = 0; delete[] newContact; //abort; } } return 0; }