Yes, I'm doing this just to make sure that the function is reading from the beginning of the input file. There is another place in my program which uses this same file to get the sum of the values in the file, so I just wanted to make sure that it is reading from the front.
And yes the code you have above works for me too, I don't understand why its not working inside my function though. That's exactly the code I have it should be working.
Perhaps check the success of inF1.open(), instead of just calling ios::clear() regardless.
Calling ios::clear() resets your streams internal error flags, but if there was a genuine problem with opening the stream in the first place, then you're just ignoring it and whatever you read from such an invalid stream is likely to be junk.