找出四元素求和里的 bug

来自 C 风格数组
C++23 (GCC 13.3.0) 入门 4分钟 找出 1处问题

找出这个函数的边界错误;它应当只累加 4 个元素。

C++
int total_four(const int (&values)[4]) {
    int total = 0;
    for (int index = 0; index <= 4; ++index) {
        total += values[index];
    }
    return total;
}
在试验场中打开
报告错误