Read and write to a memory location

前端 未结 9 1251
忘掉有多难
忘掉有多难 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:21

    That is the correct way to write data to memory location 0x1000. But in this day and age of virtual memory, you almost never know the actual memory location you want to write to in advance, so this type of thing is never used.

    If you can tell us the actual problem you're trying to solve with this, maybe we can help.

提交回复
热议问题