#include "Vector.hpp" Vector::Vector(long length) { size = length; array = new (nothrow) int[size]; if(array==NULL) { cerr << "Memory allocation failure!" << endl; exit(-1); } for(int i=0; i=size) { cerr << "Invalid access position!\n"; return array[size-1]; } return array[pos]; }