Mehes Andrew F J
2004-01-18 03:25:33 UTC
In hangman, I have getchar() in a loop to read the character guesses from
the user. However, once the user hits enter, the loop goes on to execute
the rest of the code in the loop, the executres the loop again reading the
user input as a blank and processing this blank before asking for a new
letter. Something similar is also happening in Guessing Game. I was just
wondering if any knew what might be causing this problem. I have been able
to fix it with some if statements, but I am still searching for a reason
for this phenomenon.
Thanks.
the user. However, once the user hits enter, the loop goes on to execute
the rest of the code in the loop, the executres the loop again reading the
user input as a blank and processing this blank before asking for a new
letter. Something similar is also happening in Guessing Game. I was just
wondering if any knew what might be causing this problem. I have been able
to fix it with some if statements, but I am still searching for a reason
for this phenomenon.
Thanks.