Whereever the implementation wants to.
The compiler couldn't care less. It could allocate them together with
ordinary variables, in a writable memory segment. If you change their
value behind the compiler's back, you deserve *anything* you get.
Furthermore, the automatically allocated ones may have their values
computed at run time, so the compiler cannot allocate them in read only
memory.
Let's make things clear.
There are no 'Constant Variables' in C. A constant [expression] can't
be a variable. Its a datum that is not an object. It has no address.
There are no 'variables' in C, the term is not defined by the
language, although it is used casually in a few places.
A variable can have the 'const' qualifier. In that case, it is defined
Well, then, what do you call those things where you can put a value
and refer to them by name? I've apparently been wrong all lo these many
years.
If the value can be changed, they're usually called variables, whether
Jack Klein likes it or not. Even the C standard calls them like this.
OTOH, if the value cannot be changed, the term "constant variable" is the
canonical example of an oxymoron. Unfortunately, the obvious name for
them, "constants", does not really reflect their semantics in a C program,
as they are (named) read-only objects, rather than genuine constants, i.e.
they cannot be used in constant expressions.
Dan