Error message for String length

Jan 11, 2015 at 1:00pm
Hi I was wondering how to create an error message that stops user entering a string thats 20 characters long?
Jan 11, 2015 at 1:08pm
Put it in a do-while loop
1
2
3
4
string input;
do {
    cin >> input;
} while (cin && input.size() > 20);
Jan 11, 2015 at 1:39pm
Thanks :)
Topic archived. No new replies allowed.