fork(1) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5.  
  6. static void Swap(ref string a, ref string b) {
  7. string c = b;
  8. b = a;
  9. a = c;
  10. }
  11.  
  12. public static void Main()
  13. {
  14. string a = "a";
  15. string b = "b";
  16. Swap(ref a, ref b);
  17. Console.WriteLine(a);
  18. Console.WriteLine(b);
  19. }
  20. }
Success #stdin #stdout 0.03s 23856KB
stdin
Standard input is empty
stdout
b
a