fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void foo(ref int x)
  6. {
  7. x = 42;
  8. }
  9.  
  10. public static void Main()
  11. {
  12. int answer;
  13. foo(ref answer);
  14. }
  15. }
  16.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
2
10
42
11
compilation info
prog.cs(13,17): error CS0165: Use of unassigned local variable `answer'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty