|
class point3d{
public:
float x(){return _x;
private:
static float _x;
};
main()
{
point3d rout;
point3d *pt=&rout;
cout<<rout.x()<<endl<<pt->x()<<endl;
}
上面程序中,总是报error LNK2001: unresolved external symbol "private: static float Point3d::_x" (?_x@Point3d@@0MA)错误,我把static 去掉,就可以运行了,请大虾指示! |
|