www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/27/15:15:13

From: sparhawk AT eunet DOT at (Gerhard Gruber)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Strange DJGPP bug
Date: Sun, 27 Sep 1998 17:11:51 GMT
Organization: Customer of EUnet Austria
Lines: 28
Message-ID: <360f7198.28712909@news.Austria.EU.net>
References: <slrn70rpos DOT 5bh DOT user AT ts001d22 DOT cin-oh DOT concentric DOT net>
NNTP-Posting-Host: e239.dynamic.vienna.at.eu.net
Mime-Version: 1.0
NNTP-Posting-Date: 27 Sep 1998 16:12:23 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Destination: user AT ts001d22 DOT cin-oh DOT concentric DOT net (Test User)
From: Gruber Gerhard
Group: comp.os.msdos.djgpp
Date: 27 Sep 1998 04:10:07 PDT:

>When compiled with DJGPP, the program just sits there until
>the user types something and presses ENTER. Then, the
>program spews out the Input: prompt and the string the
>user typed at the same time. For some reason, it executes
>fgets() first, and then executes both printf's together. You
>can't get it to print the prompt first, then call fgets(),
>and then print the results. You can substitute fgets() for
>your own elaborate loop system. You'll get the same result.

It behaves exactly as it should. Standard I/O is buffered and usually
triggered when a '\n' character appears. You can either issue a fflush(stdout)
after the prompt or add a newline after "Input".

--
Bye,
   Gerhard

email: sparhawk AT eunet DOT at
       g DOT gruber AT sis DOT co DOT at

Spelling corrections are appreciated.
ICQ#: 18578771

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019