Home > Back-end >  C const variable at compile time need specific initial value?
C const variable at compile time need specific initial value?

Time:09-24


Two contradictions how explanation?? O bosses teach thank you!

CodePudding user response:

reference 1st floor InTheSolitude response:
this is zhejiang university c + + don't refute teacher thank you
learn some the art of speaking, retort to consult, science better place is a lot of problems can use facts to judge, no matter how the cow X, your teacher at the compiler output with the fact that he want to inconsistent in front, he won't insist,

CodePudding user response:


Don't know the size of the values at compile time, so he complains!
Related to compile tools, some compile tool allows you to define an array using variables, some do not!
So it is recommended to use Visual Studio series

CodePudding user response:

reference Chen Zhongfu reply: 3/f
Quote: refer to 1st floor InTheSolitude response:

This is zhejiang university c + + don't refute teacher thank you
learn the art of some speak retort to consult, science better place is a lot of problems with the facts to judge, no matter how the cow X, your teacher at the compiler output with the fact that is not the same as he wants to, he won't insist,

Thanks for the advice of

CodePudding user response:

reference 4 floor MianHou response:

Don't know the size of the values at compile time, so he complains!
Related to compile tools, some compile tool allows you to define an array using variables, some do not!
So it is recommended to use Visual Studio series

Ok I guess this dev doesn't update something outrageous!

CodePudding user response:

You still go to know about the C99 standard,
It is not allowed in the C + +, but most of the C/C + + compiler is not separation, in order to fully compatible with the C99 allows,
Microsoft flagship of c + + VS, don't care,

CodePudding user response:

1. The variable-length array is C99, rather than a c + +,
2. VC though has supported many C99 features, but the longer array or not to support,
So can't use VC compiler,
3. Compiled using GCC, you need to specify the -- STD=c99
  • Related