#include <string> int main() { std::string str = "Hello, World!"; str.pop_back(); // str is now "Hello, World" }