Read and write to a memory location

前端 未结 9 1408
忘掉有多难
忘掉有多难 2021-01-05 05:40

After doing lot of research in Google, I found below program

#include 

int main()
{
    int val;
    char *a = (char*) 0x1000;
          


        
9条回答
  •  忘掉有多难
    2021-01-05 06:10

    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.

提交回复
热议问题