Folks,
I have look at the other threads, and they say to capture the value returned by scanf to see if the user just hit the enter key.
I get nothing back if I just hit enter...
When I enter a single character then enter, I get a returned value of 1.
Here is the code snippet:
printf ("Please give me a single digit number >> "];
Number = getchar ();
while (getchar() != '\n');
here is the oputput from just entering return:
Give me one, single, letter, please >>
|
Note: The cursor drops to the following line, but the program hangs waiting for "something" to read. I need to capture the enter and I'm stumped. Can the wizards help. No, this isn't for an assignment, I'm the professor and I want to demonstrate this, along with other uses of ctype.h. This one is hanging me up.
[COLOR=rgba(255, 255, 255, 0.85)]
[/COLOR]