다음을 통해 공유


경고 C26483

값 'value'가 변수 'variable'의 범위(0, 'bound')를 벗어났습니다. 배열(bounds.2)의 범위 내에 있는 상수 식을 사용하여 배열로 인덱싱하기만 합니다.

참고 항목

C++ 핵심 지침 Bounds.2

예제

void function()
{
    std::array<int, 3> arr1 { 1, 2, 3 };
    arr1[3] = 4; // C26483, 3 is outside the bounds of the array

    int arr2[] { 1, 2, 3 };
    arr2[3] = 4; // C26483, 3 is outside the bounds of the array
}