Javier Flores

Javier Flores

  • NA
  • 3
  • 5.4k

Convert VarPtr code in c# to c

Jul 24 2010 3:01 AM
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)