how can i detect that an"Enter" key has been pressed.I want to continue the program after confirming that the pressed key is an Enter key.I am using GCC!
how can i detect that an"Enter" key has been pressed.I want to continue the program after confirming that the pressed key is an Enter key.I am using GCC!
What if user presses some other key then Enter.
Say user presses 'A' then 'a' will appear on user screen. That sometimes looks ugly.
Is there any way to hide the characters that are entered through keyboard. So that they won't be displayed on user screen.
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.
I am just asking it for knowldge if it can be done or not. And if yes then how.
I also know that if you will give user message "Press Enter to Continue " then he will press Enter only not other keys.
But say that you want to DETECT that ONLY Enter key is pressed then what ?
The purpose of this message board is to share knowledge and gain knowledge and not to say anybody that your point is pointless.