Can we assign a value to a given memory location?

后端 未结 7 2138
自闭症患者
自闭症患者 2021-02-05 23:07

I want to assign some value (say 2345) to a memory location(say 0X12AED567). Can this be done?

In other words, how can I implement the following function?



        
7条回答
  •  别跟我提以往
    2021-02-05 23:53

    The fact that you are asking this question kind of indicates that you're in over your head. But here you go:

    *(int *)0x12AED567 = 2345;
    

提交回复
热议问题