lundi 22 mars 2021

standard c output won't print to console

I have encountered a very strange issue with printing to console using std::cout in a c++11 application under CentOS.

printf("Before...\n");  // This gets printed with no issue
std::cout << "This won't be printed to console\n" << std::flush; // This won't get printed
std::cout.flush();
printf("After...\n");  // This gets printed with no issue

The output in the console is:

Before...
After...

The cout message for some reason is not printed. There is no stdout redirection in my code and I am confused as to where to track down the issue.

What could be the issue? Can someone help?

Aucun commentaire:

Enregistrer un commentaire