C, embedded comments and preprocessors

brian_helterline brianh at hpcvia.CV.HP.COM
Fri Sep 21 03:14:55 AEST 1990


mills at ccu.umanitoba.ca (Gary Mills) writes:
>lwv27 at CAS.BITNET writes:

>>I have not been able to afford a copy of the new ANSI std for c,
>>and perhaps it clarifies the situation.

>You are relying on nested comments, and even the original K&R states
>that `comments do not nest'.

>>I have for some time commented out portions of code by surrounding them by
>>a construct similar to:

>A better way to remove some code from the compilation is with:

>#ifndef OLD_STUFF

>lines of code   /*  line comment */

>lines of various text's comments

>lines of code   /*  line comment */

>#endif


Even better is to use

#if 0

lines of code   /*  line comment */

lines of various text's comments

lines of code   /*  line comment */

#endif



More information about the Comp.lang.c mailing list