www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/12/04:30:13

Xref: news2.mv.net comp.os.msdos.djgpp:5902
From: broeker AT I_should_put_my_domain_in_etc_NNTP_INEWS_DOMAIN (Hans-Bernhard Broeker)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: gotoxy
Date: 11 Jul 1996 08:32:17 GMT
Organization: I need to put my ORGANIZATION here.
Lines: 31
Message-ID: <4s2e6h$67g@news.rwth-aachen.de>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 960709082517 DOT 1036B-100000 AT is> <4s27ju$5jl AT news DOT ysu DOT edu>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

randall williams (ac387 AT yfn DOT ysu DOT edu) wrote:

> >On Mon, 8 Jul 1996, Sxren Merser wrote:
> >> Do anyone know why 'gotoxy(int x, int y)' dosn't work.
[...]
> I'm having the same problem. Below is a similar code fragment to what
> I was using. On my system it fills the screen and then scrolls.
> Compiled with another compiler it works fine. If this still works,
> let me know and I'll send the actual program in email.

> #include <conio.h>
> #include <stdio.h>

> int x,y;

> main(){
>   for(x=0;x<256;x++){
>     for(y=0;y<256;y++){
>       gotoxy(1,1);
>       printf("%d %d",x,y); 
>      /* in my program I did some math here */
>     }
>   }
> }

Now, that's easy: you ought to have use 'cprintf()' instead of 'printf()',
and all would have been well. Mind you: printf is for output to the
stdout stream, it knows nothing about things like cursors, colors or
whatsoever. That's what cprintf() is for.

Hans-Bernhard Broeker (Aachen, Germany)

- Raw text -


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