I'm using ifstream to read data from a file, with eof() to see when I'm at the end of it (and in the example below writing double data to screen). I've been using it in the following way for a while:
it works fine, but I thought this was supposed to be wrong (reading the last data twice). I'm uncomfortable with switching to the last method in case it suddenly works the normal way again... ideas?