C's printf and fprintf(stdout,) are not printing

穿精又带淫゛_ 提交于 2019-11-29 13:13:08

Output is often buffered by the system. You can call fflush, but sometimes, depending on how the caching works, simply ending the output with a newline is sufficient. So try changing

fprintf(stdout, "STARTED!");

to

fprintf(stdout, "STARTED!\n");

And, if that doesn't help, to

fprintf(stdout, "STARTED!\n");
fflush(stdout)

(And stderr often isn't cached, as you want to see errors immediately.)

Finally, you will see output when the program finishes (as things are flushed then), which probably explains the rest of the behaviour.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!