fork(4) download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace test
  5. {
  6. public class test
  7. {
  8. public static void Main()
  9. {
  10. List<int> x = new List<int>();
  11. x.Add(1);
  12. x.Add(4);
  13. x.Add(9);
  14. foreach(int i in x){
  15. x[2] = 3;
  16. }
  17. foreach(int i in x){
  18. System.Console.WriteLine(i);
  19. }
  20. }
  21. }
  22. }
stdin
Standard input is empty
compilation info
prog.cs(14,37): warning CS0219: The variable `i' is assigned but its value is never used
Compilation succeeded - 1 warning(s)
stdout
1
4
3