When compiled by gcc and then run, the code
int *p;
int main() {*p = 1;}
causes a segmentation fault.
Apparently, the memory location contained in p cannot be written to.
Why????
On the other hand,
int q[];
int main() {*q = 1;}
runs just fine.
What's going on here??
Why does p contain only read-only memory?