View Single Post
  #1 (permalink)  
Old March 14th, 2005, 11:46 AM
eye_of_telescope eye_of_telescope is offline
Registered User
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

Reply With Quote