ExamVeda
Login
Home
Miscellaneous in C Sharp
?

What will be the output of the following C# code snippet?
class UnsafeCode
 {
     unsafe static void Main()
     { 
         int[] nums = new int[10];
         Console.WriteLine("Index pointer like array.");
         fixed (int* p = nums)
         {
             for (int i = 0 ;i <10 ;i++)
             p[i] = i;
             for (int i = 10 ;i >0 ;i--)
             Console.WriteLine("p[{0}]: {1} ", i, p[i]);
             Console.ReadLine();
         }
     }
}

Answer & Solution
Correct Answer: Option A
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.