diff options
Diffstat (limited to 'Project1/program.cpp')
| -rw-r--r-- | Project1/program.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Project1/program.cpp b/Project1/program.cpp index 1f6c0c4..acf6c8a 100644 --- a/Project1/program.cpp +++ b/Project1/program.cpp @@ -20,7 +20,7 @@ int main() size_t t = 0; contact* newContact = new contact[MAX]; int length = sizeof(newContact[MAX]); - cout << sizeof(newContact) << endl; + cout << sizeof(newContact[MAX]) << endl; while (O == 1) { cout << MAX << endl; @@ -33,6 +33,11 @@ int main() 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); @@ -56,12 +61,6 @@ int main() delete[] newContact; //abort; } - ++t; - if (t >= MAX) - { - newContact[MAX] = contact_double(newContact, MAX, t); - //MAX = max_double(MAX); - } } return 0; }
\ No newline at end of file |