Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cout << "Enter text to add to the end (Enter + Ctrl+Z + Enter to stop adding): " << endl;
- string s;
- cin.ignore();
- getline(cin, s, static_cast<char>(EOF));
- cin.clear();
- s = s.substr(0, s.length() - 1);
Advertisement
Add Comment
Please, Sign In to add comment