fork download
  1. using System;
  2. using System.Linq;
  3.  
  4. public class Test
  5. {
  6. struct MyStruct
  7. {
  8. public int index;
  9. }
  10.  
  11. public static void Main()
  12. {
  13. int?[] row = new int?[] {0,null,1,2,3,0};
  14.  
  15. MyStruct[] ar = row.Select(
  16. (el, ind) => el == 0 ? new MyStruct? {index? = ind} : null
  17. ).Where(el => el != null).ToArray();
  18. }
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(16,47): error CS1525: Unexpected symbol `?'
prog.cs(16,54): error CS1525: Unexpected symbol `}'
Compilation failed: 2 error(s), 0 warnings
stdout
Standard output is empty