diff options
| author | Syndamia <kamen@syndamia.com> | 2024-05-10 12:27:14 +0300 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2024-05-10 12:27:14 +0300 |
| commit | eb6305c8b0a71a613a34edbcabdaf1fde259451d (patch) | |
| tree | 2ba4402c82569810ab4287175670193597cc52d4 /week12/Exercise3 | |
| parent | 8dd9b39fa54a91030cdd5fe71973f78f7e8089e0 (diff) | |
| download | oop-2023-solutions-eb6305c8b0a71a613a34edbcabdaf1fde259451d.tar oop-2023-solutions-eb6305c8b0a71a613a34edbcabdaf1fde259451d.tar.gz oop-2023-solutions-eb6305c8b0a71a613a34edbcabdaf1fde259451d.zip | |
[w12] Finished ex 4
Diffstat (limited to 'week12/Exercise3')
| -rw-r--r-- | week12/Exercise3/TelecommunicationCompany.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/week12/Exercise3/TelecommunicationCompany.cpp b/week12/Exercise3/TelecommunicationCompany.cpp index b059edb..7b877ca 100644 --- a/week12/Exercise3/TelecommunicationCompany.cpp +++ b/week12/Exercise3/TelecommunicationCompany.cpp @@ -1,13 +1,6 @@ #include "TelecommunicationCompany.h" #include "MobileDevice.h" -void TelecommunicationCompany::free() { - for (int i = 0; i < size; i++) { - delete devices[i]; - } - delete[] devices; -} - void TelecommunicationCompany::resize() { allocated *= 2; MobileDevice** moreDevices = new MobileDevice*[allocated]; @@ -18,6 +11,13 @@ void TelecommunicationCompany::resize() { devices = moreDevices; } +void TelecommunicationCompany::free() { + for (int i = 0; i < size; i++) { + delete devices[i]; + } + delete[] devices; +} + TelecommunicationCompany::TelecommunicationCompany() { devices = nullptr; allocated = size = 0; |
