[SDL] #if 0 ???

Torsten Giebl wizard at turricane.org
Mon Jul 22 18:46:01 PDT 2002


AH! :-)

THANKS.


"nbs" <nbs at sonic.net> schrieb im Newsbeitrag news:mailman.1027370465.12219.sdl at libsdl.org...
> On Mon, Jul 22, 2002 at 10:26:33PM +0200, Torsten Giebl wrote:
> > I know this is OFFTOPIC but what means #if 0 ??? I asked it here, because it might be interesting for
> > other Coders too.
> >
>
> It's an #if statement which will never be true.  (0 is false :^) )
>
> So it's an easy way of doing something like this:
>
>
>   /*
>
>     a whole
>     bunch of code
>     you wish to
>     comment out
>
>   */
>
>
> Except it's not affected by any existing comments.  e.g.:
>
>
>   /*
>
>     this could cause    /* foo-bar-baz */
>     a syntax error      /* <-- this is no longer commented-out! */
>
>   */                    /* <-- this is a syntax error! */
>
>
> So you just go:
>
>
>   #ifdef 0
>
>     stuff you
>     want commented out      /* comments won't affect it */
>     go here
>
>   #endif
>
>
>
> Silly, but it works.
>
> -bill!
>





More information about the SDL mailing list