Hi All,

I am trying to write a value at given address location, But i am getting segmentation fault, Following is code, Please have look and help to find out the error cause.

Code:
#include <stdio.h> 


int main(){


  *(volatile int*)0x879844156 = 1; // write
  int var = *(volatile int*)0x879844156; // read 
  printf("var=%d\n",var);


  return 0; 
}


~/trial/pointer 307$ gcc pointer_conversion_1.c -w
~/trial/pointer 308$ ./a.out
Segmentation fault

Thanks and Regards,
Rahul Kumar