I know this is not about freebsd but i have noticed you guys are quit good 
at C and i am a new learner of the language. I am codeing a number guessing 
game all you do is pick a number between 1 and 136.. Now the problem is when 
the player answers it correctly it ouputs would you like to play again.. 
When it prompts for your answer it automaicly acwers it self.I figured out 
why it does is becuse there a values still in the keyboard buffer so i used 
fflush(stdin); to get rid of them but fflush(stdin); did not work so i put 
in an extra scanf statement right before the printf and scanf so it looks 
like this:

scanf("%c", &qNa);
printf("WOULD YOU LIKE TO PLAY AGAIN?(y/n)>");
scanf("%c", &qNa);

is there anyone that might know why the fflush did not work???? I fugre this 
works besuse it shoves an empty vale into the buffer thus casuseing it to be 
empty.....

Dan



_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to