3 ms·
#define DEBUG i<num+100 The example is silly, but you should get the point. DEBUG can be anything.
by ncruces 2y ago
#define DEBUG i<num+100
The example is silly, but you should get the point. DEBUG can be anything.
- robinsonb5 2y agoFair point, however your example is a runtime check, so shouldn't result in dead code. (And if DEBUG is a static define then it still won't result in dead code since the preprocessor will remove it, and the compiler will never actually see it.) EDIT: and now I realise I misread the first example all along - I read "#if (DEBUG)" rather than "if (DEBUG)".