From owner-freebsd-hackers Thu May 23 15:38:20 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from hotmail.com (f107.law9.hotmail.com [64.4.9.107]) by hub.freebsd.org (Postfix) with ESMTP id D594437B401 for ; Thu, 23 May 2002 15:38:08 -0700 (PDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 23 May 2002 15:38:08 -0700 Received: from 64.40.88.87 by lw9fd.law9.hotmail.msn.com with HTTP; Thu, 23 May 2002 22:38:08 GMT X-Originating-IP: [64.40.88.87] From: "echo dev" To: hackers@freebsd.org Date: Thu, 23 May 2002 22:38:08 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 23 May 2002 22:38:08.0837 (UTC) FILETIME=[832EBF50:01C202AA] Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message