delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/03/23:45:28

From: "Ian Perez" <fish AT discover DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Gotoxy() Malfunction
Date: Wed, 3 Jun 1998 20:40:43 -0700
Organization: DiscoverNet
Lines: 26
Message-ID: <6l553f$rgr$1@arctic.discover.net>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980602191245 DOT 20326P-100000 AT is>
NNTP-Posting-Host: redlandsts4-29.discover.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Eli Zaretskii wrote in message ...
>
>On Tue, 2 Jun 1998, KINO wrote:
>
>> -The cursor's position isn't as I wrote or
>> -The cursor's position is O.K. but the printf() function I wrote doesn't
>> appear. After quiting the program I press Alt+F5 and what a surprise that
>> all sentences wroten (write) appear at the bottom of the screen.
>
>You are using gotoxy together with printf.  This is a bad idea, since
>direct console I/O and stdio functions don't mix well.  Use cprintf
>instead.  The DJGPP FAQ list (available as v2/faq210b.zip from the same
>place you get DJGPP) discusses this in more detail in section 9.4.

I had that problem for the longest time, but I finally figured it out.  When
you use printf() or gotoxy(), for some reason, it doesn't show up on the
screen until the program exits.  But if you use fflush(stdout) after a
printf() or gotoxy(), it should clear up the problem.  I hope it works out
:)

    Ian Perez (fish AT discover DOT net)

- "It is by will alone I set my mind in motion"


- Raw text -


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