Should I use vector or array?
Vector is better for frequent insertion and deletion, whereas Arrays are much better suited for frequent access of elements scenario. Vector occupies much more memory in exchange for managing storage and growing dynamically, whereas Arrays are a memory-efficient data structure.Yes, you should use a std::vector for a buffer of statically-unknown size. You can also use a std::array for a buffer …