vivasuzi
Programmer
- Jun 14, 2002
- 183
I'm using an input file, and I want to always start from the beginning of the file everytime I open it. My prob is this. I list the contents of a file. It works, i close the file. Later I need to list the contents again, but it's the eof.
I tried--> input.seekg(0,ios::beg);
But when i do this right after--> cout<<endl<<input.tellg()<<endl;
it outputs -1.
No cfile stuff. I just need to be able to read the same input file, from the start, over and over. thanx in advance. *Suzanne*
I tried--> input.seekg(0,ios::beg);
But when i do this right after--> cout<<endl<<input.tellg()<<endl;
it outputs -1.
No cfile stuff. I just need to be able to read the same input file, from the start, over and over. thanx in advance. *Suzanne*