I think you are thinking too much (or perhaps you are thinking of a different program) since in the program posted in post #1, data is an int, not a char, and the first comparison with EOF was made...