X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Mon, 7 Jan 2002 15:10:14 -0500 Message-Id: <200201072010.g07KAEA00886@envy.delorie.com> From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: (charlieo AT ukonline DOT co DOT uk) Subject: Re: scanf References: Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > scanf("%d ", &d); > printf("%d ", d); > > not print integer immediately, instead requiring to press a non-numerical > character first? Because the console (stdin/stdout) is line-oriented. You have to enter a whole line, and then your program processes it. You have to print a whole line before it's printed. Try using fflush(stdout) for the second problem; for the first you should use fgets() or one of the console-specific functions like getkey(). Besides, if you don't press a non-numerical character, how does your program know that you're done typing in the number?