The following states what is an unmanaged code −
Here is the module showing how to declare and use a pointer variable. We have used the unsafe modifier here.
Let us see the example −
static unsafe void Main(string[] args) { int var = 20; int* p = &var; Console.WriteLine("Data is: {0} ", var); Console.WriteLine("Address is: {0}", (int)p); Console.ReadKey(); }