#include #include const double pi = 0; // with const and an initialization value, gcc will put it in read-only memory void f( void) { printf( "f: pi = %g\n", pi); } int main( void) { double *p = (double *) π *p = 4*atan(1); f(); } /* sample runs: $ alias GCC gcc -std=c11 -pedantic -Wall $ GCC badpi.c $ ./a.out Segmentation fault (core dumped) $ GCC -g badpi.c $ gdb -q ./a.out Reading symbols (gdb) run Starting program Program received signal SIGSEGV, Segmentation fault. 0x0000000000400538 in main () at badpi.c:11 11 *p = 4*atan(1); (gdb) */