Originally Posted by jodie
Thanks for the answer but Is there anyway that I can set the variable at command prompt for APP_DEBUG and export that variable to make APP_DEBUG become TRUE so the printf statement will be executed.
If I add #define APP_DEBUG TRUE then I need to recompile the code again and I don't want to do that.
This stuff, as someone said, is intended for programmers only. So, you have to define the macro if you want to get the debug info (and recompile afterwards).
You can also re-make the stuff by defining this at the command line like "make -DDEBUG" (or whatever the macro is called on your program).
If you intend to implement debug stuff that can be accesible by the user, you should be looking at adding one parameter to your program. Then read it in main, if the given param is enabled, then printf whatever.