www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/24/00:10:35

Xref: news2.mv.net comp.os.msdos.djgpp:3031
From: gfedor AT lerc DOT nasa DOT gov (Gregory Fedor)
Newsgroups: comp.os.msdos.djgpp
Subject: Odd printf behaviour
Date: 23 Apr 1996 20:35:00 GMT
Organization: ADF Inc. / NASA Lewis Research Center
Lines: 29
Message-ID: <4ljetk$bvh@sulawesi.lerc.nasa.gov>
NNTP-Posting-Host: gfedor.lerc.nasa.gov
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I wrote some simple code that utilizes the gotoxy() and printf() 
statements to place text on the screen, ala:

	while(!done)
	{
		gotoxy(column, line);
		printf(" %... ", ...);

		// update column
		// update line
	}

When I run this type of code nothing appears on the screen.  I can see 
the cursor jumping around, but nothing else.  However, if I include a 
'\n' in the printf statement, things display fine, *or* as soon as I 
printf with a '\n' outside the loop, then **all** the text gets 
displayed.  It's almost as if it's being buffered, and isn't displayed 
until a '\n' comes along.

I'm stumped, anyone got a hint?

Thanks
Gregory

-------------------------------------------------------------------------------
Gregory A. Fedor                          ADF Inc. / NASA Lewis Research Center
Computer Engineer                               Microgravity Experiments
    work: gfedor AT lerc DOT nasa DOT gov  http://sven.lerc.nasa.gov/~gfedor (216)977-1247
personal: gfedor AT en DOT com         http://www.en.com/users/gfedor

- Raw text -


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