I have a log file that is constantly updated every several milliseconds. It contains lines that either start with a 1 or a 0. I am trying to read it from the beginning and cout the lines that start with a 1 to the console. Then once I am caught to the current time, just listen for a file update and cout new lines as they come in. Each time I reach the end of the file, my program throws an error instead of waiting for the next line to be logged. How can I wait for new updates?
//Open the File
//Create a single character to quit when ready.
//Get lines one by one and only cout those where first character is ==1.
cout <<"Could not open file."<<endl;
Thanks so much for that. But the file is being written too. As soon as I run the program, it reads all the way to the last line and gives "Press any key to continue." I need it to continue to print out the upcoming lines that are being logged. That's the real issue. Any ideas?