Mail Archives: djgpp/1997/09/13/01:38:42
----------
> From: Benjamin Audy <baudy AT total DOT net>
> To: djgpp AT delorie DOT com
> Subject: Redirection
> Date: Friday, September 12, 1997 9:25 PM
>
> 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"
It would help to see some code, although I suspect you are getting user
input.
> returns a character from stdin (the keyboard in my case), which is
Actually, getchar() returns an int, not a char.
> 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?
What do you mean by "'getchar' output"? getchar() is an input function.
*putchar()* on the OTOH, is your ouput function...
Kurt
- Raw text -