Mail Archives: djgpp/1996/07/12/04:30:13
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 -