Created
November 10, 2010 01:56
-
-
Save TkTech/670214 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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