Answers for "string back function"

0

string back function

// string::back
#include <iostream>
#include <string>

int main ()
{
  std::string str ("hello world.");
  str.back() = '!';
  std::cout << str << '\n';
  return 0;
}

Output:
hello world!
Posted by: Guest on March-26-2021

Code answers related to "string back function"

Browse Popular Code Answers by Language