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

c / c++ question

Options
  • 20-01-2006 9:26am
    #1
    Moderators, Technology & Internet Moderators Posts: 37,485 Mod ✭✭✭✭


    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 Posts: 5,335 ✭✭✭Cake Fiend


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


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


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


Advertisement