, , const static. , .
const , , , . , const. .
, . , static, , ( "" ), . , , , const.
- , C, ?
.
- , , .
- .
- The return value of a function is not a constant expression.
- Thus, a variable with a static storage duration cannot be initialized with the return value from the function.
As you can see, this had nothing to do with the keyword const, but everything related to where the variable was declared. If the variable, constor not, was declared inside the local scope, it would be nice to initialize it with any value, as shown in the code example.
source
share