我想定义一个全局的结构体数组
在stdafx.cpp中定义如下:
struct twoyuan
{
int code;
CString str; };
twoyuan lettertable[36];在stdafx.h中:
extern twoyuan lettertable[36];
编译没有错误,连接时出现:
syntax error : missing ';' before identifier 'lettertable'
fatal error C1004: unexpected end of file found
我用这种方法定义其他类型变量都没问题,就结构体不行...
请问应该怎么定义全局结构体数组啊?
在stdafx.cpp中定义如下:
struct twoyuan
{
int code;
CString str; };
twoyuan lettertable[36];在stdafx.h中:
extern twoyuan lettertable[36];
编译没有错误,连接时出现:
syntax error : missing ';' before identifier 'lettertable'
fatal error C1004: unexpected end of file found
我用这种方法定义其他类型变量都没问题,就结构体不行...
请问应该怎么定义全局结构体数组啊?
{
int code;
CString str; };
放在stdafx.h里定义吧
前面少了struct
应该写成
struct lettertable[36];