Mail Archives: djgpp/2003/02/25/10:30:10
"helen" <lab_darzo AT libero DOT it> wrote in
news:6a5a8fa116bf7cfe3195a3dd08958be4 DOT 113557 AT mygate DOT mailgate DOT org:
> I have DJGPP working fine even with allegro.
> it's on win98.
>
> I run this and a blank screen goes. why ? (see below)
> ---
> /* parabola non centrata nell'origine */
>
> #include <stdio.h>
> #include <math.h>
> #include <conio.h>
>
> int main()
> {
> int h,w;
> clrscr();
this clears the screen.
> h=300;
> w=200;
> gotoxy(120,350);
this is definitely out of bounds for text mode (80x25).
> textcolor(4);
> printf("il testo è in 120,350\n");
you shouldn't mix stdio functions with conio functions. so, you should
have used cprintf here. however, since you set the output coordinates to
somewhere beyond the textmode screen, that would have probably crashed
your program.
> getchar();
>
> // ORA DISEGNO LA FINESTRA...
> textbackground(4);
> window(10, 20, 10+w, 20+h);
again, this window spans an area larger than the text mode screen.
> getchar();
> return 0;
> }
>
> I suppose conio.h is not linked or the RHIDE is not well configured.
> any help ???
header files are not linked, they are #include'd. I think the conio
functions are in the DJGPP libc, so they would be linked automatically.
The answer is simple, the screen is cleared because you called clrscr().
It is probably not a good idea to try to draw a parabola in text mode.
Sinan.
--
A. Sinan Unur
asu1 AT c-o-r-n-e-l-l DOT edu
Remove dashes for address
Spam bait: mailto:uce AT ftc DOT gov
- Raw text -