Here is the code
#include <stdio.h>
int main(void) {
int * ptr = (int*)0x12345678;
printf("%d", *ptr);
return 0;
}
I got a segmentation fault. But why? Because the virtual address 0x12345678 is not yet allocated? So why it is not allocated on the fly? But even if it is not allocated, there should be some bits at the address, and I can just print the 4 bytes beginning at the address 0x12345678 as an integer?