aboutsummaryrefslogtreecommitdiff
path: root/week12/Exercise3
diff options
context:
space:
mode:
Diffstat (limited to 'week12/Exercise3')
-rw-r--r--week12/Exercise3/TelecommunicationCompany.cpp14
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;