Message-Id: <199709130537.AAA10753@fly.HiWAAY.net> Reply-To: From: "Kurt Wall" To: "Benjamin Audy" , Subject: Re: Redirection Date: Sat, 13 Sep 1997 00:37:00 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Precedence: bulk ---------- > From: Benjamin Audy > 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