Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- csharp> using System.Runtime.InteropServices;
- csharp> BitConverter.GetBytes (32);
- { 32, 0, 0, 0 }
- csharp> var bytes = BitConverter.GetBytes (32);
- csharp> var handle = GCHandle.Alloc (bytes, GCHandleType.Pinned);
- csharp> int value;
- csharp> Marshal.PtrToStructure (handle.AddrOfPinnedObject (), value);
- csharp> value;
- 0
Add Comment
Please, Sign In to add comment