fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. unsafe public static void Main()
  6. {
  7. // your code goes here
  8. int[] arr = { 0, 1, 2, 3, 4, 5 };
  9. Console.WriteLine(arr[0]);
  10. fixed (void* ptr = arr)
  11. {
  12. int* int_ptr = (int *)ptr;
  13. char* char_ptr = (char *)ptr;
  14. *char_ptr = 'a'; char_ptr++;
  15. *char_ptr = 'b'; char_ptr++;
  16. *char_ptr = 'c'; char_ptr++;
  17. *char_ptr = 'd'; char_ptr++;
  18. }
  19. Console.WriteLine(arr[0]);
  20. }
  21. }
Success #stdin #stdout 0.02s 16016KB
stdin
Standard input is empty
stdout
0
6422625