12345678
string userinput; // -- get userinput from the user here, however you're doing it -- if(userinput.length() > 10) { // -- give an error to the user -- }