Compartir vía


Advertencia C26483

El valor 'value' está fuera de los límites (0, 'bound') de la variable 'variable'. Solo indexe en matrices mediante expresiones constantes que estén dentro de los límites de la matriz (bounds.2).

Consulte también

C++ Core Guidelines Bounds.2

Ejemplo

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
}