I'm trying to have a debugging mode on so if
#define DEBUG 1
I want to printf some variable values and if
#define DEBUG 0
I want them off.
The problem is I have many implementation files and I want this DEBUG variable to be available for the whole project. Right now I need to edit the DEBUG variable in foo1.c, foo2.c, foo3.c which seems tedious and error-prone and there must be a better way. Any suggestions?