Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

c / c++ question

  • 20-01-2006 8:26am
    #1
    Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭


    ok, I want to read from stdin, one character at a time. I don't want to wait for the '\n'. getc() waits for \n. cin.get(c) waits for \n, etc. etc.

    Any googling turns up getc(), but it's obviously not what I want (as I want to validate input as it's coming in).

    This is just p*ssing me off now. :/


Comments

  • Registered Users, Registered Users 2 Posts: 5,335 ✭✭✭Cake Fiend


    Check out getch() and getche(), but be aware that they're not ANSI-compliant.


  • Registered Users, Registered Users 2 Posts: 2,002 ✭✭✭bringitdown


    cin.peek() and cin.ignore() may help you ... leave the fun bits up to you!


Advertisement