NomanProdhan
Level 1
Write the reason you're deleting this FAQ
Detection of the end-of-file condition is necessary for preventing any further attempt to
read data from the file.
An ifstream object, such as fin, returns a value of 0 if any error occurs in the file operation including the end-of-file condition. Thus, the while loop terminates when fin returns a value of zero on reaching the end-of-file condition. Remember, this loop may terminate due to other failures as well......There is another approach to detect the end-of-file
condition.