Is there a way I can mute all my printf statements conditionally, however, without using any macros? I want to accomplish the muting without touching the already existing code, but adding a line to my module which would simply disable all printf’s already existing in the source code.
Thanks!
If you want to nullify all output to
stdoutviaprintf,puts,putchar, etc., you can usefreopen(3)to redirect it to a bit bucket, e.g.: