Mail Archives: djgpp/1997/08/20/06:40:15
Lawrence Kirby wrote:
> >> I have been messing around with Borland C for a while. I wanted to
> >> try that free 32 bit compiler DJGPP. I finally figured out what I
> >> had to download. I also got RHIDE, the free IDE. So, I wrote my
> >> first little C in the new compiler.
> >>
> >>#include <stdio.h>
> >>#include <conio.h>
> >>#include <dos.h>
> >>
> >>main()
> >>{
> >>clrscr();
> >>printf("Hello there\n");
> >>getch();
> >>printf("See You Later!");
> >>delay(1000);
> >>}
> >>
> >>And here is the funny thing. This program wrote nothing until I hit
> >> a key. It was Obviously supposed to write "Hello there" first.
i do not know what is going on there but when i compile the file i
created by cutting & pasting the code you gave using the command line
gcc ttt.c -o ttt.exe
and run ttt.exe, i get
clear screen
"Hello there"
delay
"See you later"
in _THAT_ order.
i have no idea why things were different for the original poster.
> here? A simple test for the original poster would be to see what this
> does:
>
> #include <stdio.h>
>
> int main(void)
> {
> printf("Hello there\n");
>
> for (;;)
> ;
> }
displays "Hello there" and hangs as expected. I would like to stress
though that I have compiled and run the code that supposedly does not
display "Hello there" until after the getch, and have seen no such
behavior. i do not know who this original poster is, but maybe the code
they posted and the one they actually compiled were different?
-- Sinan
- Raw text -