File Read In is Blank

http://ideone.com/JXUmpI

Hi, I am not seeing any output to monitor when I try to read from file. The file contents is commented at the bottom of the code so its in one place.
Obviously its separate file when I am compiling through terminal on Ubuntu.

It must be something really stupid that I am overseeing.

I am trying to only read the file contents after all the error checks that are in place.

Thanks in advanced

Code is in the above link.
Last edited on
you reach eof() in the `isEmpty()' function
But wouldn't that never execute since the file is clearly not empty? Upon the correct file name input and all those checks would fail, it should execute the else statement only. Or am I missing a simple logistical error here.

EDIT: I commented out that check, and by golly it read the file. Now it would be nice to get an explanation on why that is happening. Hmm
Last edited on
I have fixed it.

Added these two lines of code in the empty function if the file was not empty before it returns out

file.clear();
file.seekg(0, std::ios::beg);

Thank you ne555 for narrowing down the problem!
Last edited on
Topic archived. No new replies allowed.