Enter Key

This is a discussion on Enter Key within the Linux Programming forums, part of the Platform Specific Boards category; how can i detect that an"Enter" key has been pressed.I want to continue the program after confirming that the pressed ...

Look I know its stupidity that user types in the things and characters are not echoed to the screen.

But I am talking in reference to current problem.

That only pressing enter key will exit or continue.

So if we use getchar() function in a continuous loop until '\n' is encountered then still if user presses other keys the program stays at that point only with all characters typed by users seen on the screen So I am saying this looks ugly (It's not a bogus claim) Think about it.