How to check whether end of file is reached or not without having to read the next string?
Actually the case is that, in my code, I want to check two times whether the next character leads to end of file or not. First time I will check it by reading the next string but second time I can't check this way becoz the required string has already been read. So how to check the the second time without having to read the string again or moving the file pointer behind...
(file.peek() does not solve the problem. That has been explained in comment.)