I am trying to read from a text file that is continuously getting more and more data. Since the rate that it is being updated with data is slower than the rate that C++ is running I am having problems with the program. I am trying to put the file reader inside of a infinite loop (which should continuously read a line even when it reached the end of the file).
int main ()
while(a<1) // To get you all the lines.
getline(infile,STRING); // Saves the line in STRING.
if (STRING != previousLine)
cout<<STRING<<endl; // Prints our STRING.
It works until it reaches the end of the file. Does anyone have any sugestions on how I can achieve a file reader in C++ that reads at the speed that data is being added to the text file?
Maybe my code would help the others who needs the easy example. ^_^
It can be run under Qt4.
using namespace std;
int main(int argc, char *argv)
QCoreApplication a(argc, argv);