This documentation is archived and is not being maintained.

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
   }
}
Show: