What is the size of sizeof(vector)? C++

Use the vector::size() method: i < v.size().

The sizeof operator returns the size in bytes of the object or expression at compile time, which is constant for a std::vector.

Leave a Comment