So after I have read in a text file for my C++ program, when I go to read in the last line of my file using getline it goes into an infinite loop. Now I know this has been asked before on stack overflow, but my problem is I am not supposed to use .eof, or anything related to the ifstream library, which all of the answers I have checked contain.
How can I signal my program that the end of the file has been reached WITHOUT using .eof or anything in < ifstream > so that I can prevent this infinite loop?