不要有定义
楼主闲麻烦可以再用个文件(不是头文件)
把他包进去
或者做个函数
头文件都要有函数来做
syntax error : '{'
unexpected token(s) preceding '{'; skipping apparent function body
我想他大概意思是没有找到你函数
嵌入式 ARM 单片机 驱动 RT操作系统 J2ME LINUX Symbian C C++ 数据结构 JAVA Oracle 设计模式 软件工程 JSP
发个源码过来看看吧,有可能是在作用域外调用了不该调用的东西吧
class CAaDlg : public CDialog
{
// Construction
public:
int aa[3][4]={{1,2,3,4},{1,2},{5,4,3,2}};
CAaDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CAaDlg)
enum { IDD = IDD_AA_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAaDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CAaDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class CAaDlg : public CDialog
{
// Construction
public:
int aa[3][4]; //如果是想让他为公有成员就放这声明。
//你在定义这个构造函数的时候
//把aa[3][4]={{1,2,3,4},{1,2},{5,4,3,2}};加进去就可以了。
CAaDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CAaDlg)
enum { IDD = IDD_AA_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAaDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CAaDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//这是类定义
class CAaDlg : public CDialog
{
// Construction
public:
int aa[3][4];
CAaDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CAaDlg)
enum { IDD = IDD_AA_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAaDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CAaDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//这是构造函数
CAaDlg::CAaDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAaDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CAaDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
aa[3][4]={{1,2,3,4},{1,2},{5,4,3,2}};
}