Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!wuarchive!rice!uw-beaver!milton!kenney From: kenney@milton.u.washington.edu (Michael Kenney) Newsgroups: comp.lang.c++ Subject: istream problem Message-ID: <1991May23.181402.7912@milton.u.washington.edu> Date: 23 May 91 18:14:02 GMT Sender: kenney@milton.u.washington.edu (Michael Kenney) Distribution: usa Organization: University of Washington, Seattle Lines: 35 I've been trying to get the hang of C++ streams and I've run into an anoying problem. I'm trying to read a stream to EOF, rewind to the beginning and read it again, ie: func(istream &in) { . . . while(in.get(c)) { // Do something } in.seekg(0, ios::beg); // This loop FAILS while(in.get(c)) { // Do something else } } The problem is, the second while loop never iterates, in.get() returns 0. I used in.tellg() to insure that the stream is repositioned, and it is. Am I missing something obvious? Please email your responses. Thanks. Mike Kenney UW Applied Physics Lab mikek@apl.washington.edu mike@apl-at.apl.washington.edu