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

2
  • can u show us your code Commented Dec 2, 2015 at 11:32
  • @RohanGala I got no code at all hah. Commented Dec 2, 2015 at 11:36

1 Answer 1

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).

Sign up to request clarification or add additional context in comments.

3 Comments

Any code as example?
@DimitrisKatikaridis: sure: there are plenty (including some I posted in the distant past, including this). Just search the Internet for the keywords provided! It seems now it is time for you to do work.
Thanks for this.will work in it and I will comment

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.