What will be the output of the following C# code snippet? [code] class UnsafeCode { unsafe static void Main() { int[] nums

What will be the output of the following C# code snippet?
Code:
class UnsafeCode
{
    unsafe static void Main()
    {
        int[] nums = new int[10];
        fixed (int* p = &nums[0], p2 = nums)
        {
            if (p == p2)
            Console.WriteLine("p and p2 point to same address.");
            Console.ReadLine();
        }
    }
}
A. Run time error
B. Compile time error
C. p and p2 point to the same address
D. Only p2
 

Tìm kiếm

Back
Top