#include int main() { const int a = 12; int *p; p = &a; *p = 70; }
Will it work?
Modifying a const qualified object through a pointer invokes undefined behaviour, and such is the result. It may be something you'd expect from a particular implementation, e.g. the previous value unchanged, if it has been placed in .text, etc.
const
.text