Skip to content

Instantly share code, notes, and snippets.

@nikhilm
nikhilm / tryjsil.cs
Created April 11, 2013 21:20 — forked from TryJSIL/tryjsil.cs
Simple Unsafe Structs
using System;
using System.Runtime.InteropServices;
public static class Program {
public static unsafe void Main (string[] args) {
var bytes = new byte[8];
fixed (byte* pBytes = bytes) {
var pStruct = (MyStruct*)pBytes;
*pStruct = new MyStruct {