6.4.9 Comments

Previous Table of Contents "New C Standard" commentary

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

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

936 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.

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

938 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;

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

Next

Created at: 2008-01-30 02:39:42 The text from WG14/N1256 is copyright © ISO