Edit

Share via


Compiler Error CS0443

Syntax error, value expected

This error occurs when you reference an array without specifying a value for the array index.

Example

The following code generates CS0443.

// CS0443.cs
using System;
class MyClass
{  
    public static void Main()
    {  
        int[,] x = new int[1,5];  
        if (x[] == 5) {} // CS0443  
        // if (x[0, 0] == 5) {}
    }  
}