c# - How to write to memory address? -


new pointers , unsafe world in c#. going through getting memory address of variables via pointers, move things around bit here , there etc; learning.

static unsafe void m() {     var = 1;     var p = &i; //gets memory location of variable here      //how write location p, value of 100? } 

i wondering if there way write specific location well? helps great deal see what's going around if can read , write @ same time.

no practical purposes, learning. or not possible c#?

you need dereference pointer * operator. ex:

*p = 100; 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -