string. back() code example
Example: 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!
// string::back
#include <iostream>
#include <string>
int main ()
{
std::string str ("hello world.");
str.back() = '!';
std::cout << str << '\n';
return 0;
}
Output:
hello world!