|
|
|
|
|
by einpoklum
1515 days ago
|
|
There is no compilation-time evaluation of functions and statements in C. You have constants, which can be expressions, but that's about it. Oh, and macros of course. compile-time evaluation was introduced in C++11 and expanded in subsequent versions of the language standard. |
|
Doing
works in both C and C++, but with a catch: in C++, X is evaluated at compile time (it has internal linkage), while in C this works only after C99 because it's actually a VLA.