When I print out pi it's as if it's overwritten , does that mean I don't need to use #undef? Can someone give me an example of when I would need it and redefining it wouldn't work.
Here, the state of DEBUG can be used to control which lines of code are actually compiled. By changing a single line of code, e.g. changing line 1 into a comment, the program can be effectively changed in many places in one go.
#undef can be used to limit the scope of the define, in a similar way to braces { } which can limit the scope of other identifiers.