Hello
Got This error say's that i should make default constructor even after i did it still come out different error
before the default constructor i got
: error C2512: 'pointtype' : no appropriate default constructor available ( LN64)
after i put default constructor i got this error
Error 1 error LNK2019: unresolved external symbol "public: __thiscall pointtype::~pointtype(void)" (??1pointtype@@QAE@XZ) referenced in function _main Code.obj
Error 2 fatal error LNK1120: 1 unresolved externals C:\Users\Hani\ClassPointType\Debug\ClassPointType.exe
PHP Code:
#include <iostream>
using namespace std;
class pointtype
{
private :
int x;
int y;
public :
void setx(int);
void sety(int);
int getx();
int gety();
pointtype();
pointtype(int e,int f);
void print();
~pointtype();
};
class circle : public pointtype {
private:
float r;
public:
void print();
circle(float);
~circle();
void setr(float);
float getr();
float calculatearea();
float calculatecircumfrance();
};
void pointtype::setx ( int a) {
x=a;
}
void pointtype::sety ( int d) {
y=d;
}
int pointtype::getx () {
return x;
}
int pointtype::gety () {
return y;
}
pointtype::pointtype() {
x=0;
y=0;
}
pointtype::pointtype(int e, int f) {
x=e;
y=f;
}
void pointtype::print () {
cout <<x<<y<<endl;
}
int main () {
pointtype c1;
c1.setx (10);
c1.sety (5);
c1.print();
system ("pause");
}




Reply With Quote