when you 'getch' you're taking the next character off of the input queue for processing.
this assumes once you've processed it, you're done with it, and will (probably) eventually want to get another character off the input queue.
'ungetch' puts that input back on the input queue.
this effectively allows you to "peek" at the input queue and know what the next character is without destroying it, so that it can be used again at some other point.
Reputation Points: 2143
Solved Threads: 178
Posting Maven
Offline 2,567 posts
since Feb 2008