delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/12/23:34:40

From: baudy AT total DOT net (Benjamin Audy)
Newsgroups: comp.os.msdos.djgpp
Subject: Redirection
Date: Sat, 13 Sep 1997 02:25:01 GMT
Message-ID: <3419f6a5.3549236@news.total.net>
NNTP-Posting-Host: 207.139.25.219
Organization: TotalNet Inc.
Lines: 17
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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?

Normally, everything should be sent to the file, like when I redirect
the "debug" program output.

Benjamin Audy
baudy AT total DOT net

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019