You must not go out of bounds, the
C/C++
developer has to be precise. That said, you could use
std::vector
instead of a plain array: it provides the
std::vector::at - cppreference.com[
^] method that throws an exception if you try to make an out-of-bounds access.