I need to write conditional debug program which inserts debug statements depending on debug levels. I have the following code. However this results in syntax error with gcc.
Well, the problem is, besides the fact that preprocessor directives don't nest, that the value of level is only known at run time. If you want to do it like this, you'll have no choice but to make the check every time.