After doing lot of research in Google, I found below program
Google
#include int main() { int val; char *a = (char*) 0x1000;
Issue of permission, the OS will protect memory space from random access.
You didn't specify the exact error, but my guess is you are getting a "segmentation fault" which would clearly indicate a memory access violation.
segmentation fault