get pointer to value
Published: 15. January 2009 | Updated: 15. January 2009License: Microsoft Public License (MS-PL)
Categories: Framework » Unsafe Code
Tags: C# Unsafe
// assign value to variable int a = 10; // create pointer to variable int* p = &a; // write value of variable Console.WriteLine(a); // write address of variable (hexadecimal) Console.WriteLine("{0:X}", (int)p);Console Output:
10
44CECC8
44CECC8
| Send us feedback about this snippet » |





