0

firstly thanks for all.

My question

I want to force console not allow me even type ,after a cin,when I have typed 5 characters.

I need something like "checking while you type"... I don't know ... I need a string only 5 chars length PLUS not allow me type more than 5 chars while imputing

Thanks

1 Answers1

0

On UNIXes you'd put the standard input stream into non-canonical mode (using the flag ICANON if I recall correctly) with tcgetattr() and tcsetattr(). Once that's done you need to deal with each character hit and display characters as appropriate.

On other systems you'll probably use orher approaches (e.g., kbhit() if I recall correctly).

Dietmar Kühl
  • 150,225
  • 13
  • 225
  • 380