Read and write to a memory location

前端 未结 9 1374
忘掉有多难
忘掉有多难 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条回答
  •  梦毁少年i
    2021-01-05 06:25

    You can write to a specific memory location.

    But only when you have the rights to write to that location.

    What you are getting, is the operating system forbidding you to write to 0x1000.

提交回复
热议问题