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

thanhthao

New member
What will be the output of the following C# code snippet?
Code:
class UnsafeCode
{
    unsafe static void Main()
    {
        int a = 2;
        int b = 4;
        int *a1 = &a;
        int *b1 = &b;
        Console.WriteLine(*a1 + *b1);
    }
}
A. 6
B. print garbage value
C. print -6
D. print address of b + a
 

Tìm kiếm

Back
Top