I'm writing a small program to mimic the unix tail -f command. I'm confident I am doing it correctly, but for some reason none of the cout's are printing to the console. I through in the cout << "Start" << endl; right at the beginning in case the code was getting stuck somewhere, but it doesn't even display!
I'm using the linux Code::Blocks IDE, console comes up and stays open. Even tried running the compiled binary directly in the terminal, runs but nothing prints.
It could be that the file fails to open. In that case start_end will probably be equal to new_end so the else part of the if statement in the loop will be run. The call to getline will return immediately because the stream is in an error state. The next line will print an empty line (because line is empty). The loop will run very fast and output a lot of empty lines so you never have time to notice any output at the beginning
Thanks, that was it. It shouldn't be scrolling down though without printing the new lines from syslog. Must be something in my logic, changed the while loop to while (in.is_open()) and it definitely is opening.