Consider the following. I have a text file with 5 rows of 5 characters each. I want to read in a line and then compare it to all the other lines. I create 2 ifstream objects pointing to the same file, first and second. first reads in the first line. I would then like second to take over from first, effectively starting at that position in the file and compare the remaining lines until the end of the file. first then is in the right position to read in the second line. second would again take over from first and start at the beginning of line 3 and compare etc etc

Naively I thought I could read the first line in with first then set second=first and continue but I'm led to believe that objects can't be equated like this.

In reality I am dealing with a very large data file hence the need to remove redundancy i.e. not compare two lines more than once.

Any thoughts?
Thanks.

I think I've solved it. I use fstream and then second.seekg(first.tellg()) should do the trick, right?

Thanks again.