www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/09/28/07:06:57

Date: Thu, 28 Sep 1995 11:18:27 +0100
From: Andreas Busse <andy AT soft-n-hard DOT de>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: problems with delay

 > 
 > I have such problem. I wrote hello word program and added to this
 > program after printf   delay(5000) (gppconio.h was included)
 > but delay was done before printf
 > even if there were for (i=0;i<value;i++) printf("%d\n",i);
 > for cycle was done from 0 to i=98 after it program delayed 5 sec and
 > after it printed 99
 > What I'm doing wrong?
 > I'm running gpp 2.6.0
 > 

You might need to add a fflush(stdio) between the printf()
and delay() calls to make sure that the output is printed
immediately. Otherwise the characters just sit in queue
somewhere waiting for a buffer to be filled.

Andy

-----------------------------------------------------------
Andreas Busse                      | andy AT soft-n-hard DOT de
Soft N Hard GbR                    | Phone: +49 2636-970105
Im Hufen Boden 16, D-53498 Waldorf | Fax:   +49 2636-970106
-----------------------------------------------------------

- Raw text -


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