Mail Archives: djgpp/1997/09/14/14:53:08
At 02:25 9/13/1997 GMT, Benjamin Audy wrote:
>Hi!
>
>I don't think this is a problem for DJGPP specifically, but here it
>is:
>
>In my program I use the "getchar" and "printf" functions. "getchar"
>returns a character from stdin (the keyboard in my case), which is
>also echoed to the screen (line buffered). But when I redirect the
>output at the command prompt (eg.: "program.exe > file.txt"), "printf"
>output is sent to the file, but "getchar" output is still sent to the
>screen. Why?
The echo always goes directly to the screen. If you want it to go to stdout
as well, you'll have to putchar() or printf() it explicitly.
>
>Normally, everything should be sent to the file, like when I redirect
>the "debug" program output.
>
>Benjamin Audy
>baudy AT total DOT net
>
>
Nate Eldredge
eldredge AT ap DOT net
- Raw text -