Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
Since all you are reading is a character, use getchar() . But remember that you did hit the ENTER key too. You therefore have to clear the buffer. So when you read a character, use something like
whatever = getchar(); // at least one character left in the input stream
do
{
dummy = getchar(); // read another character
} while (dummy != '\n'); // stop when newline is read
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944