#pragma once #include using namespace std; const int DEFAULT_CAPACITY = 10; /// /// An array holding some integer values /// class Array { private: int* ptr; int size, capacity; /// /// Increase the capacity of the array /// /// New capacity void increaseCapacity(int newCapacity); public: explicit Array(int startCapacity = DEFAULT_CAPACITY); Array(const Array&); ~Array(); Array& operator = (const Array& arr); int& operator [] (int index); /// /// Insert element into position /// /// The value to be inserted /// The position to insert the value into void insert(int elem, int index); /// /// Remove element from array /// /// The index of the element to be removed void remove(int index); /// /// Get current size of the array /// /// The size of the array int getSize() const; friend ostream& operator <<(ostream& out, const Array& arr); };