Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!helios!jadam From: jadam@cs.tamu.edu (James P Adam) Newsgroups: comp.lang.c++ Subject: Using C++ Streams Keywords: portable compilers preprocessors Message-ID: <13731@helios.TAMU.EDU> Date: 25 Mar 91 22:45:31 GMT References: <1991Mar11.181823.9414@falcon.no> <284@nazgul.UUCP> Sender: usenet@helios.TAMU.EDU Organization: Computer Science Department, Texas A&M University Lines: 28 I'm working on a DOS machine, and I'm trying to use the C++ streams library of stuff to read control-characters from the keyboard. What I'd like to be able to do, for instance, is to ask for some input (an integer, say) and be able to abort the request if the first character hit is the ESCAPE key. The problem is that characters like ESCAPE, CTRL-S, CTRL-P, CTRL-Z, etc., never get through to my program if I use cin. What I used to do, back in plain C, was to use machine-specific get()-type functions that read keystrokes from the BIOS without echoing them, and without letting them go through the operating system. I could still do this, but if I'm going to link in the streams library, I'd like avoid having to link in other input-output routines if at all possible. Especially in short programs, the overhead of all these library routines starts to get pretty heavy. I tried to do something like: istream_withassign noEcho = cin; but the compiler complained, even though cin is supposed to be of class istream_withassign. A general question that relates to this matter: Are there any reference books available for the streams library? The books I've seen cover the library in one chapter, if you're lucky, and they rarely go beyond talking about cin/cout/cerr. According to Borland, the streams library consists of more than a hundred classes; it'd be kinda nice to know something about some of those classes && be able to use them. Jim