Wednesday, January 4, 2012

What is the structure of a comment?

The syntax of a C comment is:

/* Any text, number, or character */

where there should be no blanks(s) between the slash and the asterisk. In addition, the /* and */ must form a couple. The /* and */ are called comment delimiters.
The /* and */ must form a couple, but they need not be on the same line. Therefore, a comment line may occupy more than one line. A multi-line comment starts with /* followed by multiple lines of text consisting of numbers, characters, or symbols. The multi-line comment terminates with */.

Examples of incorrect comments:

/* Wrong comment 1, and no end asterisk and slash
/* Wrong comment 2, no end slash
/ *Wrong comment 3, there is a blank between / and * */

No comments:

Post a Comment