diff options
Diffstat (limited to 'Project1')
| -rw-r--r-- | Project1/Contacts.h | 2 | ||||
| -rw-r--r-- | Project1/contacts.cpp | 6 | ||||
| -rw-r--r-- | Project1/program.cpp | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/Project1/Contacts.h b/Project1/Contacts.h index 51f5620..d44e6c5 100644 --- a/Project1/Contacts.h +++ b/Project1/Contacts.h @@ -28,6 +28,6 @@ void update(contact newContact[], size_t MAX); void printAll(contact newContact[], size_t MAX); -char contact_double(contact*& newContact, size_t MAX, size_t t); +void contact_double(contact*& newContact, size_t MAX, size_t t); #endif CONTACTS_HEADER_H
\ No newline at end of file diff --git a/Project1/contacts.cpp b/Project1/contacts.cpp index f40e7f2..4f2ec9e 100644 --- a/Project1/contacts.cpp +++ b/Project1/contacts.cpp @@ -24,7 +24,7 @@ int menu() char addNew(contact newContact[], size_t MAX, size_t t) { - for (int i = t; i < MAX; i++) + for (size_t i = t; i < MAX; i++) { newContact[i].id = i + 1; newContact[i].count = t; @@ -63,7 +63,7 @@ void update(struct contact newContact[], size_t MAX) int c = 0; cin >> c; int t = c - 1; - for (int i = t; i < MAX;) + for (size_t i = t; i < MAX;) { cin.ignore(1000, '\n'); cout << "Please enter each piece of information when you are prompted to" << endl; @@ -112,7 +112,7 @@ void printAll(contact newContact[], size_t MAX) } } -char contact_double(contact*& newContact, size_t MAX, size_t t) +void contact_double(contact*& newContact, size_t MAX, size_t t) { contact* doubleContact = new contact[MAX * 2]; diff --git a/Project1/program.cpp b/Project1/program.cpp index 74fce1e..19ef0d2 100644 --- a/Project1/program.cpp +++ b/Project1/program.cpp @@ -30,7 +30,7 @@ int main() //c = menu(); if (c == 1) { - addNew(&newContact[MAX], MAX, Cont_list_lenth); + addNew(&newContact[Cont_list_lenth], MAX, Cont_list_lenth); if (Cont_list_lenth >= MAX) { contact_double(newContact, MAX, Cont_list_lenth); @@ -39,11 +39,11 @@ int main() } if (c == 2) { - update(&newContact[MAX], MAX); + update(&newContact[Cont_list_lenth], MAX); } if (c == 3) { - printAll(&newContact[MAX], MAX); + printAll(&newContact[Cont_list_lenth], MAX); } if (c == 4) { |