有关类的一些问题请大家指教啊
写个小程序如下: #include <iostream.h> class XXX { private : int a; int b; public: XXX(); void w(int,int); void s(); };
void XXX::w(int x,int y) { a=x;b=y; } void XXX::s() { cout <<"\n"<<a<<"\n"<<b; } void main() { XXX n; int a,b; cout<<"input a,b:"; cin >> a>>b; n.w(a,b); n.s();
} 编译通过了,但按F7后出现如下错误: -------------------Configuration: 6 - Win32 Debug-------------------- Compiling... 6.cpp Linking... 6.obj : error LNK2001: unresolved external symbol "public: __thiscall XXX::XXX(void)" (??0XXX@@QAE@XZ) Debug/6.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe.
6.exe - 2 error(s), 0 warning(s) 请指教一下!!!