“error C2533: 构造函数不能有返回类型”,怎么回事?
VC.NET下
error C2533: 构造函数不能有返回类型
把函数里的代码注释掉也没用。
class RSBase
{
public:
RSBase(void);
virtual ~RSBase(void);
int m_nTopLeftX;
int m_nTopLeftY;
int m_nLength;
bool m_bMoveLeft;
bool m_bMoveRight;
bool m_bMoveDown;
bool m_bDeformation;
int m_nDeformCount;
RSArr **m_pDefaultRS;
RSArr *m_pCurrentRS;
};
class RSLeftL :
public RSBase
{
public:
RSLeftL(void);
~RSLeftL(void);
static const int m_nCount = 4;
};
RSLeftL::RSLeftL(void)
{ //这里是出现错误的行
m_nTopLeftX = 4;
m_nTopLeftY = 2;
m_nLength = 3;
m_bMoveLeft = false;
m_bMoveRight = false;
m_bMoveDown = false;
m_bDeformation = false;
m_nDeformCount = 0;
int init[4][3][3] = {
{0, 2, 0, 0, 2, 0, 0, 2, 2},
{0, 0, 2, 2, 2, 2, 0, 0, 0},
{2, 2, 0, 0, 2, 0, 0, 2, 0},
{0, 0, 0, 2, 2, 2, 2, 0, 0}
};
m_pDefaultRS = new RSArr*[m_nCount];
for(int i = 0; i < m_nCount; i++)
{
m_pDefaultRS[i] = new RSArr(m_nLength);
m_pDefaultRS[i]->Init(&init[i][0][0]);
}
m_pCurrentRS = m_pDefaultRS[0];
}