<<< std::vector as a stack | Index | STL Iterators >>> |
size_type size() const; bool empty() const; size_type capacity() const;
You can use resize( ) to change the size of a vector.
If it gets longer, the new elements are initialized with the second argument.
void resize( size_type n, T x = T() );
reserve( ) does the same thing for capacity,
but without any initialization. Current content is preserved.
void reserve( size_type n );
<<< std::vector as a stack | Index | STL Iterators >>> |