SyntaxFix
Write A Post
Hire A Developer
Questions
buf.erase(buf.size() - 1);
This assumes you know that the string is not empty. If so, you'll get an out_of_range exception.
out_of_range