I have a question regarding storage of constants in C.
If I have the following statement:
const int a = 5;
If the statement was in global scope, the constant would be stored in .rodata . I have been working with the TI compiler for MSP430 devices. If the statement was in local scope, the constant is stored on the stack .
I am not sure what would happen if I declare it as a "static const" in local scope, but I would expect it to be stored in .rodata .
Is this behavior correct?