1.

What is the size of a char pointer?(a) 1 byte(b) 2 byte(c) 3 byte(d) 4 byteThis question was posed to me in an interview for job.Asked question is from Unsafe code & Pointers Basics topic in chapter Miscellaneous topics of C#

Answer»

Correct answer is (B) 2 byte

Explanation: class UnsafeCode

{

unsafe STATIC VOID Main()

{

char CH;

Console.WriteLine(sizeof(char));

Console.ReadLine();

}

}

The sizeof() method helps in CALCULATING size of char pointer.



Discussion

No Comment Found

Related InterviewSolutions