12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #pragma once
- #include <iostream>
- using namespace std;
- const int DEFAULT_CAPACITY = 10;
- class Array
- {
- private:
- int* ptr;
- int size, 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);
-
-
-
-
-
- void insert(int elem, int index);
-
-
-
-
- void remove(int index);
-
-
-
-
- int getSize() const;
- friend ostream& operator <<(ostream& out, const Array& arr);
- };
|