Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!jarthur!uunet!brunix!sdm From: sdm@cs.brown.edu (Scott Meyers) Newsgroups: comp.lang.c++ Subject: istream::putback(char c) Message-ID: <71302@brunix.UUCP> Date: 8 Apr 91 19:00:07 GMT Sender: news@brunix.UUCP Reply-To: sdm@cs.brown.edu (Scott Meyers) Organization: Brown University Department of Computer Science Lines: 24 From the istream man page: insp=&ins.putback(c) Attempts to back up ins.rdbuf(). c must be the character before ins.rdbuf()'s get pointer. (Unless other activity is modifying ins.rdbuf() this is the last character extracted from ins.) If it is not, the effect is undefined. Two questions: 1. Why am I limited to putting back the last character I removed? There is no such limitation for ungetc in the standard C library. 2. Given that I am limited to putting back the last character I read, why does putback take a parameter? All illumination appreciated, Scott ------------------------------------------------------------------------------- What do you say to a convicted felon in Providence? "Hello, Mr. Mayor."