Is there any way in C to find if a variable has the const qualifier? Or if it\'s stored in the .rodata section?
For example, if I have this function:
Not in standard C, i.e. not portably.
myString
is just a char*
in foo
, all other information is lost. Whatever you feed into the function is automatically converted to char*
.
And C does not know about ".rodata
".
Depending on your platform you could check the address in myString
(if you know your address ranges).