Date: Sun, 14 Sep 1997 11:42:34 -0700 (PDT) Message-Id: <199709141842.LAA12554@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: baudy AT total DOT net (Benjamin Audy), djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Redirection Precedence: bulk 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