Quote:
Originally Posted by gpraghuram
What error you are getting?
Raghu
Ok, I think I've created all three of my constructors correctly now: But when I try to create a new xArray in my MAIN file (xArray a;), I am getting an error: (the error is posted below after the constructors which are directly below this.)
//constructor 1
xArray::xArray(){
len = 0;
size = 0;
data = new int[size];
}
//constructor 2
xArray::xArray(const xArray& a){
len = a.len;
size = len*2;
data = new int[size];
}
//constructor 3
xArray::xArray(const int x){
len = 0;
size = x;
data = new int[x];
}
//MAIN.cpp
cout << "Testing the constructors." << endl;
xArray a; //trying to create an xArray
HERE IS THE ERROR I AM GETTING: (USING VISUAL BASIC C++):
MAIN.obj : error LNK2019: unresolved external symbol "public: _thiscall xArray::~xArray(void)" (??1xArray@@QAE@XZ) referenced in function_main
MAIN.exe : fatal error LNK1120: 1 unresolved externals