Examveda

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

A. The program will print 10

B. Run time error

C. Compile time error

D. Output is the address contained in p

Answer: Option C


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

Join The Discussion

Related Questions on Miscellaneous in C Sharp