Sometimes we put some debug prints in our code this way
printf(\"successfully reached at debug-point 1\\n\");
some code is here
printf(\"successfully reached
If your program writes a lot of output, disabling buffering will likely make it somewhere between 10 and 1000 times slower. This is usually undesirable. If your aim is just consistency of output when debugging, try adding explicit fflush
calls where you want output flushed rather than turning off buffering globally. And preferably don't write crashing code...