X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Mon, 07 Jan 2002 22:29:17 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "osmosis" Message-Id: <2110-Mon07Jan2002222916+0200-eliz@is.elta.co.il> X-Mailer: emacs 21.1.50 (via feedmail 8 I) and Blat ver 1.8.9 CC: 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 > From: "osmosis" > Newsgroups: comp.os.msdos.djgpp > Date: Mon, 7 Jan 2002 19:32:49 -0000 > > why does > > int d; > scanf("%d ", &d); > printf("%d ", d); > > not print integer immediately, instead requiring to press a non-numerical > character first? Because stdout is buffered. Either use fflush or end the format string with a \n, and the output will appear immediately. See section 9.5 of the DJGPP FAQ list for more details about this.