jlgcumt 发表于 2010-2-25 15:21

结构变量问题请教

typedef struct _PowerStc
{
unsigned   SIVF   :1;
unsigned   InverF   :1;
unsigned            :6;
}PowerStc;
PowerStc PStc=(0,0);

我定义了上述结构变量。怎么老出现
this operator is not allowed in a constant expression
但我用同样的方式定义别的结构,再定义变量就没问题,是怎么回事呀?

未来是梦 发表于 2010-2-25 23:19

PowerStc PStc=(0,0);
改为PowerStc PStc={0,0};

jlgcumt 发表于 2010-3-1 17:09

多谢楼上,我写程序太粗心了。
页: [1]
查看完整版本: 结构变量问题请教