stdin and the keyboard

DOWELL mdowell at dante.nmsu.edu
Thu Jun 27 07:35:13 AEST 1991


Hello,

I've got a quick question...

I am trying to write a replacement for the DOS more command.  I would
like it to function as closely like the original as possible,
therefore piping of commands is needed, ie  dir | more.

My problem is that when I get input from the command (dir) I set the
file pointer equal to stdin, but when I go to check if a key is
pressed getch() checks stdin and grabs a character from the command.

I can't get it to recognize the keyboard and the input command 
separate instead of both being the stdin.

I am running Borland C++ on a PC if that helps any.

Any help would greatly reduce the frustration I am feeling!!! :-{

Mike Dowell

mdowell at dante.nmsu.edu



More information about the Comp.lang.c mailing list