Category : dynamic-arrays

My string-dynamic-array.cpp file #include <iostream> #include <string> class DynamicArray { public: DynamicArray() : mCapacity(1), mNumberOfElements(0) { mArray = new std::string[mCapacity]; } DynamicArray(int size) : mCapacity(size), mNumberOfElements(0) { mArray = new std::string[mCapacity]; } DynamicArray(const DynamicArray& array) : mCapacity(array.getCapacity()), mNumberOfElements(array.length()) { mArray = new std::string[mCapacity]; for (size_t i = 0; i < mCapacity; ++i) { mArray[i] = ..

Read more