J
junk mail
My friend is trying to code a small c program where he wants to force the
user to press enter and only enter to continue.
Currently he is using getchar() with a loop but you can type any number of
characters, which are echoed to screen before you have to press enter.
For example:-
do
{ /* Begin loop */
printf("\Press Enter"); /* Output to screen */
} while ((ch = getchar()) != '\n') ; /* While ( Condition -
must press enter ) */
user to press enter and only enter to continue.
Currently he is using getchar() with a loop but you can type any number of
characters, which are echoed to screen before you have to press enter.
For example:-
do
{ /* Begin loop */
printf("\Press Enter"); /* Output to screen */
} while ((ch = getchar()) != '\n') ; /* While ( Condition -
must press enter ) */