DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
C language compiler

Comments

Comments begin with the characters /* and end with the next */.

   /* this is a comment */
Except when the option -Xc is used, everything following // on the same logical line are also treated as comments:
   // this is also a comment
Comments do not nest.

If a comment appears to begin within a string literal or character constant, it will be taken as part of the literal or constant, as specified by the phases of translation.

   char *p = "/* this is not a comment */"; /* but this is */

Next topic: Preprocessing
Previous topic: Punctuators

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003