定义一数组表
const int CRobotDlg::m_paDis[27]={-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,13,12,11,10,9,8,7,6,5,4,3,2,1};
但是编译时出现syntax error:"{"
这是为什么?
const int CRobotDlg::m_paDis[27]={-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,13,12,11,10,9,8,7,6,5,4,3,2,1};
但是编译时出现syntax error:"{"
这是为什么?
============================================================================
提问题时标题要简明扼要地说明问题内容,切忌使用"急","求救"之类不能说明问题的标题
http://www.betajin.com/alphasun/index.htm 给我发信息请附带原帖地址
http://alphasun.18en.com/ http://shakingtoolkit.9126.com/
DocWizard C++程序文档自动生成工具 | Wave OpenGL | HttpProxy | AjaxParser词法分析
在.h中改成如下定义:
static const int m_paDis[27];
在.cpp 中做如下初始化:
const int m_paDis[27]={-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,13,12,11,10,9,8,7,6,5,4,3,2,1};
// 在#include 语句之后,construct function 之前
unresolved external symbol "public:static int const * const CRobotDlg::m_paDis"
class CMyDialog : public CDialog
{
// Construction
public:
...................
static const int m_paDis[27];
...................};
// MyDialog.cpp : implementation file
//#include "stdafx.h"
#include "DlgTitle.h"
#include "MyDialog.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CMyDialog dialog
const int m_paDis[27]={-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,13,12,11,10,9,8,7,6,5,4,3,2,1};CMyDialog::CMyDialog(CWnd* pParent /*=NULL*/)
: CDialog(CMyDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CMyDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
楼主这回可明白了?
郁闷!!!!!
unresolved external symbol "public:static int const * const CRobotDlg::m_paDis"