Quote Originally Posted by zizz View Post
Both std::array and std::vector are defined to have a contiguous memory layout (as of the C++ 11 standard). This means they are guaranteed to be as efficient as old-style C arrays (you're currently using) when it comes to accesses.
This is slightly off.

it'll be as efficient as old-style ALLOCATED C style array.


by it's very nature, a C style array does not need allocation or deallocation, nor does it need (indirect) access through a pointer.

in that respect c-style array -> std::array<>
heap allocated c-style array -> std::vector<>

there are cases where local vs heap allocated might be an important decision factor.