initialize array with constant number does not work

后端 未结 2 1610
南旧
南旧 2020-12-12 04:59

I get the following error when I use constant nVar instead of a number.

constants.h:

extern const unsigned int nVar;
         


        
2条回答
  •  一个人的身影
    2020-12-12 05:41

    I think it happens because compiler should know array's size at compile time, but in your example value of nVar will be known only at linking time due to extern

提交回复
热议问题