diff options
| author | Connor McDowell <[email protected]> | 2024-02-21 16:17:47 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-02-21 16:17:47 -0800 |
| commit | a10ee9a9bc8e1a086e112a1e381b63d4a4c96112 (patch) | |
| tree | 2cff8a565810dd99348c2447c884b6dde7a20393 /Project1/program.cpp | |
| parent | still testing (diff) | |
| download | homework-6-connormcdowell275-a10ee9a9bc8e1a086e112a1e381b63d4a4c96112.tar.xz homework-6-connormcdowell275-a10ee9a9bc8e1a086e112a1e381b63d4a4c96112.zip | |
pushing
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 |