Mail Archives: djgpp/1999/05/03/08:01:55
OmniMeta wrote:
> This program won't print Hello until it end.
> if I do a step by step debug, I see that he won't show "Hello" on the screen
> until it had ended.
> And if I run the hello.exe program, I don't see Hello during the getch().
>
> How can I get printf to work correctely, to print to the screen immediately,
> before the program end ?
>
> #include <stdio.h>
> #include <conio.h>
>
> int main()
> {
> char a[]="Hello";
> int key_p;
>
> clrscr();
>
> printf("%s",a);
> key_p=getch();
> printf("\n%c",key_p);
> return 0;
> }
Are you sure? I typed in the program listing and it worked perfectly fine...
- Raw text -