Hello, I have the source code of an application written in C++ and I just want to comment something using:
#ifdef 0
...
#endif
And I get this error
error: macro names must be identifiers
Why is this happening this?. Thanks
Hello, I have the source code of an application written in C++ and I just want to comment something using:
#ifdef 0
...
#endif
And I get this error
error: macro names must be identifiers
Why is this happening this?. Thanks
Use the following to evaluate an expression (constant 0 evaluates to false).
#if 0
...
#endif
The #ifdef directive is used to check if a pre-processor symbol is defined. It's possible that your C compiler allows pre-processor symbols that start with a digit (but unlikely since it would seriously screw up the parser) and your C++ compiler doesn't.
The correct form for using the pre-processor to block out code is:
#if 0
: : :
#endif
or
#ifdef NO_CHANCE_THAT_THIS_SYMBOL_WILL_EVER_EXIST
: : :
#endif