The size checking in
set()
is wrong and you are not assigning the value:
void Vector::set(int val, int pos) {
if (pos < 0 || pos >= size) {
cout << endl << "Error Message ";
}
else
enteries[pos] = val;
}
In your destructor you should delete the allocated memory. Setting the pointer to
NULL
is useless:
Vector::~Vector() {
delete [] this->enteries;
}