Using arrays or std::vectors in C++, what's the performance gap?

后端 未结 19 1744
忘了有多久
忘了有多久 2020-11-22 03:23

In our C++ course they suggest not to use C++ arrays on new projects anymore. As far as I know Stroustroup himself suggests not to use arrays. But are there significant perf

19条回答
  •  清歌不尽
    2020-11-22 03:59

    If you do not need to dynamically adjust the size, you have the memory overhead of saving the capacity (one pointer/size_t). That's it.

提交回复
热议问题