Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- unsafe
- {
- ExampleStruct example = new ExampleStruct() { X = 'A', Y = 123321, Z = 0xDEADBEEF };
- byte* pointer = (byte*)(void*)&example;
- for (int i = 0; i < sizeof(ExampleStruct); i++)
- {
- Console.WriteLine(pointer[i]);
- }
- }
- }
- struct ExampleStruct
- {
- public char X;
- public int Y;
- public long Z
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement