C++代码哪里出错
#include <afxwin.h>
class CMyPoint : public CObject
{
public:
double x,y;
COLORREF c;
public:
CMyPoint();
CMyPoint( double srx, double sry, COLORREF src){
CMyPoint::x= srx;
CMyPoint::y= sry;
CMyPoint::c= src;
}
public:
double GetCMyPointX() {
return CMyPoint::x;
}
double GetCMyPointY() {
return CMyPoint::y;
}
COLORREF GetCMyPointC() {
return CMyPoint::c;
}
};
编译时:
Compiling...
CWin.cpp
f:\tpx\workout.h(3) : error C2011: 'CMyPoint' : 'class' type redefinition
执行 cl.exe 时出错.
TPX.exe - 1 error(s), 0 warning(s)
Why?