From: "Chris A. Triebel" Newsgroups: comp.programming,comp.os.msdos.djgpp Subject: standard input and files Date: Sun, 13 Oct 1996 13:00:03 -0400 Organization: University of New Hampshire - Durham, NH Lines: 15 Message-ID: NNTP-Posting-Host: sun4.iol.unh.edu Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Here's the scenario I need. I want to create an executable that will compile under DOS ( djgpp ) and most UNIX systems. I want a functionality like more that can take input from standard input or from a file. Like the more command ( on unix ) or grep or something. I also want to use ifstreams to do the input. Question: Can I assume that standard input is always file descriptor 0, or can I get it's file descriptor from the standard libraries of C/C++. Is it part of the C++ standards that fd0 is always going to standard input, redirected or not? TIA cat