A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.tutorialspoint.com/cpp_standard_library/cpp_string_pop_back.htm below:

C++ String pop_back Function

C++ String Library - pop_back Description

It erases the last character of the string, effectively reducing its length by one.

Declaration

Following is the declaration for std::string::pop_back.

void pop_back();
C++11
void pop_back();
C++14
void pop_back();
Parameters

none

Return Value

none

Exceptions

if an exception is thrown, there are no changes in the string.

Example

In below example for std::string::pop_back.

#include <iostream>
#include <string>

int main () {
   std::string str ("sairamkrishna Mammahe");
   str.pop_back();
   std::cout << str << '\n';
   return 0;
}

The sample output should be like this −

sairamkrishna Mammah

string.htm


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4