Mail Archives: djgpp/1998/06/02/19:00:36
KINO wrote:
>
> I'm starting to write short C programs with the djgpp compiler and i've
> found that gotoxy() function doesn't work well.
>
> After compiling the source code I execute it and :
>
> -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.
Read chapter 9.4 of the DJGPP Frequently Asked Questions list
(v2/faq210b.zip or online at http://www.delorie.com/djgpp/v2faq/).
You're attempting to mix stdio functions with conio functions, which is
never guaranteed to work as you intend. The fact that it may do so
under certain MS-DOS compilers is accidental rather than intentional.
:-)
In order to make your screen display appear correctly, you should either
substitute stdio output functions for the equivalent conio versions
(printf->cprintf, etc.), or insert fflush(stdout) after every call to
printf(), etc.
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com |
| Proud owner of what might one | http://www.cs.com/fighteer/ |
| day be a spectacular MUD... | ICQ UIN#: 7406319 |
| Plan: To make Bill Gates suffer | HEAT User ID: Fighteer |
---------------------------------------------------------------------
- Raw text -