4
Answers

Convert VarPtr code in c# to c

Photo of Javier Flores

Javier Flores

14y
5.5k
1
Hello!
can anybody helpme to resolve this, i tried to parse this c# code to c, but i failed.

public static int VarPtr(object e)
        {
            GCHandle GC = GCHandle.Alloc(e, GCHandleType.Pinned);
            int gc = GC.AddrOfPinnedObject().ToInt32();
            GC.Free();
            return gc;
        }

what exactly do these,and how i can write in c.

sorry, my english is bad.

Answers (4)