Skip to content

Instantly share code, notes, and snippets.

@TkTech
Created November 10, 2010 01:56
Show Gist options
  • Save TkTech/670214 to your computer and use it in GitHub Desktop.
Save TkTech/670214 to your computer and use it in GitHub Desktop.
using System;
namespace test
{
class MainClass
{
struct h4x {
// Fixed arrays can only be properties of structs
unsafe public fixed ushort test[512];
};
unsafe public static void Main (string[] args)
{
h4x t = new h4x();
// This pointer will point to test as a continous array of bytes
byte* b = (byte*)&t.test;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment