Follow

What is CS0022?

Symptoms

You are seeing the following error in the console window:

error CS0022: Wrong number of indexes `__' inside[], expected `__'

Cause

This error occurs when an incorrect number of values are placed into an array's square brackets. See an example below:

Error displayed in this example:

error CS0022: Wrong number of indexes `2' inside[], expected `1'

Resolution

In order to fix the CS0022 error you will need the correct number of indexes inside the [] section of the array.

In this example we can either change the myArray declaration to a 2D array or correct the statement to a single array. See below:

More Information

https://msdn.microsoft.com/en-us/library/c4aad8at(v=vs.90).aspx

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.