rewind a file

Joshua Nye josh@boxcarmedia.com
Tue Oct 1 11:04:00 GMT 2002


This program compiles and runs fine with g++ 3.2.

#include <iostream>
using namespace std;
int main() {
    cout << ios::beg;
    return 0;
}

Maybe you need the 'using namespace std;' in there?

--josh

----- Original Message ----- 
From: "Sebastian Huber" <sebastian-huber@web.de>
To: <gcc-help@gcc.gnu.org>
Sent: Tuesday, October 01, 2002 10:58 PM
Subject: Re: rewind a file


Hello,
I'm not absolutely sure about that, but I guess that 'ios' is not standard 
conform. You should try 'ios_base'.

On Tuesday 01 October 2002 09:52, Philippe Despres wrote:
> Hello,
>
> I used to rewind a ifstream file with
>
> file.seekg(0,ios::beg);
> file.clear();
>
> to read it a second time. It was under gcc 2.9x. Now I upgrade to
> mandrake 9.0, which ships gcc 3.2 and it is not working anymore... any
> hint?
>
> Thanks
>
> Philippe




More information about the Gcc-help mailing list