<ra*******@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
hello,
how to interprete following #if in code? e.g. if i have a code
like
#if 0
somefunc();
else
#else
somefunc();
#endif
The above (after my correction) means that only
the second call to 'somefunc()' (after the #else)
will become part of the translation unit. The
first call is excluded.
also what is meaning of
#if !defined(__ENVVAR__)?
It means that if, at this point, the preprocessor has not
encountered a definition of '__ENVVAR__', then everything
after the #if, up to the next #endif, #else, or #elif
will become part of the translation unit. If a definition
of '__ENVVAR' was already encountered, the inverse would
be true (everything between the #if and the next #endif,
#else, or #elif would be excluded).
This is all basic stuff. Which C textbook(s) are you
reading?
-Mike