IAR使用结构变量问题(msp430)

#defineucharunsignedcharstructFindGB16{ucharIndex[3];uchardata[32];};structFindGB16GB... #define uchar unsigned char

struct FindGB16
{
uchar Index[3];
uchar data[32];
};

struct FindGB16 GB16[]= //为结构变量初始化
{
"我", 0x20,0x24,0x24,0x24,0xFE,0x23,0x22,0x20,
0xFF,0x20,0x22,0xAC,0x20,0x30,0x20,0x00,
0x00,0x08,0x48,0x84,0x7F,0x02,0x21,0x10,
0x09,0x06,0x1A,0x61,0x80,0xE0,0x00,0x00,

"有", 0x04,0x04,0x04,0x84,0xE4,0x3C,0x27,0x24,
0x24,0x24,0x24,0xF4,0x24,0x06,0x04,0x00,
0x04,0x02,0x01,0x00,0xFF,0x09,0x09,0x09,
0x09,0x49,0x89,0x7F,0x00,0x00,0x00,0x00,

"一", 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0xC0,0x80,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

请问我这样初始化有什么问题吗?
Error[Pe101]: "FindGB16" has already been declared in the current scope (at line 3) C:\Users\Administrator\Desktop\TFT2.4\chinese.h 3

Error[Pe148]: variable "GB16" has already been initialized (at line 9) C:\Users\Administrator\Desktop\TFT2.4\chinese.h 9
为啥报错呢?
展开
 我来答
启岩
推荐于2016-05-29 · TA获得超过1851个赞
知道小有建树答主
回答量:809
采纳率:0%
帮助的人:644万
展开全部
FindGB16结构体已经定义了,你下面定义的时候只需要const FindGB16 GB16[]= {...};
另外
struct FindGB16
{
uchar Index[2];// 汉字占两个字节,所以定义成2,如果定义成3下面定义GB16数组时应该定义成 "我\0"的形式
uchar data[32];
};
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式