Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cunixf.cc.columbia.edu!sol.ctr.columbia.edu!spool.mu.edu!sdd.hp.com!caen!dali.cs.montana.edu!milton!kenney From: kenney@milton.u.washington.edu (Michael Kenney) Newsgroups: comp.lang.c++ Subject: Re: istream problem Message-ID: <1991May23.195530.8242@milton.u.washington.edu> Date: 23 May 91 19:55:30 GMT References: <1991May23.181402.7912@milton.u.washington.edu> Distribution: usa Organization: University of Washington, Seattle Lines: 28 In article <1991May23.181402.7912@milton.u.washington.edu> kenney@milton.u.washington.edu (Michael Kenney) writes: >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: > [ example deleted ] >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 > It was pointed out to me that seekg() does not reset the "eofbit", I need to call clear(). Thanks to all who replied. Mike Kenney UW Applied Physics Lab mikek@apl.washington.edu mike@apl-at.apl.washington.edu