C-style array:
1int arr[5] = {1, 2, 3, 4, 5};2arr[10] = 0; // no error, undefined behavior
std::array:
.at()1std::array<int, 5> arr = {1, 2, 3, 4, 5};2arr.at(10); // throws std::out_of_range3std::cout << arr.size(); // 5
Always prefer std::array — it's safer and more feature-rich.