api

vector::pop_back() function in C++

In C++, the vector class provides a function pop_back(). It removes the last element from the calling vector object. Table Of Contents Syntax of vector::pop_back(): Example of vector::pop_back() function Calling vector::pop_back() function on empty vector Remove all elements from vector using vector::pop_back() Summary Syntax of vector::pop_back(): Parameters: None Return value: None It accepts no argument, …

vector::pop_back() function in C++ Read More »

vector::clear() function in C++

In C++, the vector class provides a function clear(). It removes all elements from the calling vector object. It will make the size of vector 0. Table Of Contents Syntax of vector::clear(): Examples of vector::clear() Example 1 Example 2 Summary Syntax of vector::clear(): Parameters: None Return value: None Examples of vector::clear() Let’s see some examples …

vector::clear() function in C++ Read More »

Scroll to Top