Does anybody knows how can I check the EOF in c++? I want to read a file written by other application. So I want to check the EOF flag in order to determine if the other application has finished. I have tried it but eof() returns everytime 0(no matter if the file is opened or not)