So the title states the problem I'm running into with my class constructors/destructor. Here's my code:
template <class ArrType>
class SmartArray{
public:
ArrType *elements; // pointer that will point to dynamic array
int length(); // function to return array length
SmartArray<ArrType>(); // default constructor
SmartArray(int arrSize); // constructor that initializes array size
~SmartArray(); // destructor
void resizeArr(int newsize); // function that resizes array
SmartArray(const SmartArray& otherObject); // copy constructor
And here's the default constructor:
SmartArray::SmartArray(){
arrSize = 0;
elements = new ArrType[arrSize];
cout << "Created array using default constructor." << endl; // letting user know that object was successfully created
}
I did try looking the problem up but either those programs were too advanced for me to understand or I was just too stupid. In any case, I'm hoping there's a simple fix for this.