Share via


컴파일러 오류 CS0022

업데이트: 2007년 11월

오류 메시지

[] 내부의 인덱스 수가 잘못되었습니다. 'number'개가 필요합니다.
Wrong number of indices inside [], expected 'number'

배열 액세스 작업에서 대괄호 안에 지정된 차원 개수가 잘못되었습니다. 자세한 내용은 배열(C# 프로그래밍 가이드)를 참조하십시오.

예제

다음 샘플에서는 CS0022 오류가 발생하는 경우를 보여 줍니다.

// CS0022.cs
public class MyClass
{
    public static void Main()
    {
        int[] a = new int[10];
        a[0] = 0;     // single-dimension array
        a[0,1] = 9;   // CS0022, the array does not have two dimensions
    }
}