Are const variables placed in read-only memory?
c, c++, constants
Solution
`const` is a compile time construct and isn't known about at runtime. It is only there to help the programmer reason about his program and to prevent bugs being introduced by altering things that were not supposed to be altered. `const` tells the compiler that you don't want to allow this variable to be changed, and so the compiler will enforce it.
Problem
Or is there some other protection against modifying them? It makes sense if they are in read-only memory - that's the reason for making them `const`, right?