Examveda

What will be the output of the following C# code snippet?
class UnsafeCode
{
    unsafe static void Main()
    {
            int* p;
            p = (int*)(65535);
            Console.WriteLine((uint)p);
            Console.ReadLine();
    }
}

A. compile time error

B. garbage value

C. program prints value at address 65535

D. program prints 65535

Answer: Option D


This Question Belongs to C Sharp Programming >> Miscellaneous In C Sharp

Join The Discussion

Related Questions on Miscellaneous in C Sharp