出现错误:error C2143: syntax error : missing ';' before 'public' 这是为什么呢?谢谢

在vc++6.0中:

class CStudent : public CEdit
{
// Construction
public:
CString csCode; //学号
CString csName; //姓名
CString csclass; //班级
float csmath;
float csenglish;
float cscomputer;
CStudent();
// Attributes
public:

// Operations
public:

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CStudent)
//}}AFX_VIRTUAL

// Implementation
public:
virtual ~CStudent();

// Generated message map functions
protected:
//{{AFX_MSG(CStudent)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG

DECLARE_MESSAGE_MAP()
};

在.cpp 文件中写入:public CStudent Student[20];

出现错误:error C2143: syntax error : missing ';' before 'public'

请问这是为什么呢?谢谢~~
试过了 不可以亚 还是这个错误

DECLARE_MESSAGE_MAP() ;
调用函数时, 要在后面加是分号
温馨提示:答案为网友推荐,仅供参考
第1个回答  2008-01-09
DECLARE_MESSAGE_MAP() 这句后面要加分号
DECLARE_MESSAGE_MAP() ;
相似回答