In C, "/" and "/" are multi-line comment symbols, used to comment out blocks of code so that they will not be executed by the compiler. Specific usage includes: /* Mark the beginning of the comment. */ Marks the end of the comment. The content of the comment can be multiple lines of text and does not need to end with a semicolon (;).
##The meaning of / and / in C
In C, /* and
*/ are multi-line comment symbols.
Purpose:
Usage:
Marks the beginning of the comment.
Marks the end of the comment.
).
Example:
<code class="cpp">// 使用单行注释 int main() { // 这是一条单行注释 return 0; } /* 使用多行注释 */ int main() { /* 这是一个多行注释 它跨越了多行 */ return 0; }</code>
Note:
) of a nested comment must be on the same line or at the same level of nesting as the opening symbol (
/*). Otherwise, the compiler will generate an error.
The above is the detailed content of What does /* mean in c++. For more information, please follow other related articles on the PHP Chinese website!