The msdn page talks about C ++ constant expressions that:
Non-integral constants must be converted (either explicitly or implicitly) to integral types, which must be legal in constant expression. Therefore, the following code is legal:
const double Size = 11.0; char chArray[(int)Size];
At least in VC ++ 10.0, the second line produces: "error C2057: expected constant expression". Is this legal with any other compiler, or is the msdn page just plain wrong?
c ++ constant-expression msdn
zeroes00
source share