Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0196 

Error Message

A pointer must be indexed by only one value

A pointer cannot have multiple indices. For more information, see Pointer types (C# Programming Guide)

The following sample generates CS0196:

// CS0196.cs
public class MyClass
{
   public static void Main ()
   {
      int *i = null;
      int j = 0;
      j = i[1,2];   // CS0196
      // try the following line instead
      // j = i[1];
   }
}

Community Additions

ADD
Show:
© 2015 Microsoft