数组声明中放指针变量问题?

[复制链接]
2699|2
 楼主| clleady 发表于 2011-1-7 10:25 | 显示全部楼层 |阅读模式
我截取了一段
#define configuration1 {1,rGPFCON}
#define configuration2 {2,rGPFCON}
#define configurations configuration1,configuration2
Typedef struct
{
int b;
unsigned int *p;
}A
const A config[]={configurations};//不通过
//const A config[]={1,rGPFCON};  //不通过
//const A config[1]={1,2};  //通过
//const A config[]={1,2},{2,3};  //通过
前2句c编译不通过,说什么const中一定要是变量?难道指针变量就不能放在数组定义中吗?
xinzha 发表于 2011-1-7 12:19 | 显示全部楼层
检查下rGPFCON的定义
w00d 发表于 2011-1-10 22:51 | 显示全部楼层
Typedef struct
{
int b;
unsigned int *p;
}A;  //注意这个‘;’
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:活到老学到老

219

主题

477

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部