STL

vector::erase() function in C++

In this article, we will discuss all about vector’s erase() function, and how to use the vector::erase() function in C++. Table Of Contents Remove single element from vector using erase() Removing multiple elements from vector using erase() function Using vector::erase() function in the for loop Summary In C++, the vector class provides a function erase() […]

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

Convert a String to a Vector of Bytes in C++

The article here discusses various ways to convert an input string to a vector of bytes in C++. Table Of Contents Method 1: Using a For Loop Method 2: Using std::vector Constructor Method 3: Using std::transform method Method 4: Using std::copy() method Summary Method 1: Using a For Loop This program creates a string called

Convert a String to a Vector of Bytes in C++ Read More »

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 »

Scroll to Top