fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. static int[,] array = new int[3, 3]
  6. {
  7. { 0, 0, 1 },
  8. { 0, 1, 0 },
  9. { 1, 0, 0 }
  10. };
  11.  
  12. public static void Main()
  13. {
  14. Console.WriteLine(array.ToString());
  15. Rotate45(array);
  16. Console.WriteLine(array.ToString());
  17. }
  18.  
  19. public static void Rotate45(ref int[,] array)
  20. {
  21. for(int x = 0; x < array.GetLength(0); x++)
  22. {
  23. for(int y = 0; y < array.GetLength(1); y++)
  24. {
  25. array[array.GetLength(0) - 1 - y, x] = array[x, y];
  26. }
  27. }
  28. }
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(15,3): error CS1502: The best overloaded method match for `Test.Rotate45(ref int[,])' has some invalid arguments
prog.cs(19,21): (Location of the symbol related to previous error)
prog.cs(15,12): error CS1620: Argument `#1' is missing `ref' modifier
Compilation failed: 2 error(s), 0 warnings
stdout
Standard output is empty