www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/20/23:46:10

From: Vic <tudor AT cam DOT org>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Simple C question probably having to do with DJGPP
Date: Sun, 20 Sep 1998 23:04:29 -0400
Organization: Communications Accessibles Montreal, Quebec Canada
Lines: 18
Message-ID: <3605C23D.2937@cam.org>
References: <19980920183653 DOT 24923 DOT 00002490 AT ng126 DOT aol DOT com>
NNTP-Posting-Host: dialup-755.hip.cam.org
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Uhfgood wrote:
> 
> Well here's is the simple question.  consider the following code :
> 
> printf("This demonstrates a \\a escape sequence: \a");
> getch();
> 
> Now answer me this, how come it waits until a key is pressed to display the
> string?

because output in DJGPP is buffered. Don't take this as a bug, ANSI
either says output is buffered or it leaves it to the discretion of the
compiler, DJGPP is not violating anything here.

the obvious reason for it it's that DJGPP is protected mode, output to
screen is real mode, and DJGPP has to switch every time which is slow.
so it will buffer the output and only switch to real mode once to output
everything.

- Raw text -


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