6.4.9 Comments

Previous Table of Contents

927 Except within a character constant, a string literal, or a comment, the characters /* introduce a comment.

928 The contents of such a comment are examined only to identify multibyte characters and to find the characters */ that terminate it.70)

929 Except within a character constant, a string literal, or a comment, the characters // introduce a comment that includes all multibyte characters up to, but not including, the next new-line character.

930 The contents of such a comment are examined only to identify multibyte characters and to find the terminating new-line character.

931 EXAMPLE


        "a//b"                   // four-character string literal
        #include "//e"           // undefined behavior
        // */                    // comment, not syntax error
        f = g/**//h;             // equivalent to f = g / h;
        //\
        i();                     // part of a two-line comment
        /\
        / j();                   // part of a two-line comment
        #define glue(x,y) x##y
        glue(/,/) k();           // syntax error, not comment
        /*//*/ l();              // equivalent to l();
        m = n//**/o
          + p;                   // equivalent to m = n + p;

932 70) Thus, /* ... */ comments do not nest.

Next

Created at: 2005-06-29 02:18:58 The text from WG14/N1124 is copyright © ISO