fork(7) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. private static void assign(ref int i)
  6. {
  7. i = 42;
  8. }
  9.  
  10. public static void Main()
  11. {
  12. var vars = new [] { 1,2,3,4 };
  13. Console.WriteLine(vars[2]);
  14. assign(ref vars[2]);
  15. Console.WriteLine(vars[2]);
  16. }
  17. }
Success #stdin #stdout 0.01s 37056KB
stdin
Standard input is empty
stdout
3
42