Compiler Error CS0650
TOC
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error CS0650 

Error Message

Syntax error, bad array declarator. To declare a managed array the rank specifier precedes the variable's identifier. To declare a fixed size buffer field, use the fixed keyword before the field type.

An array was declared incorrectly. Be aware that the syntax for a fixed size buffer is different from that of an array.

Example

The following sample generates CS0650.

// CS0650.cs
public class MyClass
{
   public static void Main()
   {
      int myarray[2];   // CS0650
 
      // OK
      int[] myarray2 = new int[2] {1,2};
      myarray2[0] = 0;
    }
}
Show:
© 2016 Microsoft