Problems with cin
Hello,
currently i'm writing a program for my exams, and i happened upon a problem with cin. My program requies a login inputted by the user which is 20 chars long. I have written a function that cuts 20 first chars if user inputted more chars (to avoid buffer overflow), but i was wondering if it's possible to overload cin in a way that if user inserted 20 chars then no more is accepted and user is to correct inputted login or press enter.
Thanks in advance
|