Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Error CS0178
Collapse the table of content
Expand the table of content

Compiler Error CS0178

Incorrectly structured array initializer

An array initialization was ill-formed. When specifying the array dimensions, you can specify the following:

  • A number in brackets
  • Empty brackets
  • A comma enclosed in brackets

The following sample generates CS0178:

// CS0178.cs
class x
   public static void Main()
      a = new int[5][,][][5;   // CS0178, no comma or right bracket
© 2015 Microsoft