fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Test
  7. {
  8. public class Test
  9. {
  10. public delegate Tuple<int, int> func(char[] c, int i);
  11. public Dictionary<char, Delegate> func;
  12.  
  13. public Test()
  14. {
  15. func = new Dictionary<char, Delegate>();
  16. func['l'] = new func(list);
  17. //func['d'] =
  18. }
  19.  
  20. public Tuple<int[], int> list(char[] x, int f)
  21. {
  22. List<int> r = new List<int>();
  23. f = f+1;
  24. while (x[f] != 'e')
  25. {
  26. int v = f = func[x[f]](x, f); //ここでメソッド名が必要ですと言われる
  27. r.Add(v);
  28. }
  29. return Tuple.Create<int[], int>(r.ToArray<int>(), f + 1);
  30. }
  31. }
  32. }
  33.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(11,43): error CS0102: The type `Test.Test' already contains a definition for `func'
prog.cs(10,41): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty