Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

C-style multi line comment: Difference between revisions

From Coderwiki
C-style multi line comment: create
 
fix link to 'C-style single line comment' and add 'Doc comments' heading
 
Line 1: Line 1:
[[C-style comment|C-style comments]] can be either [[C-style multi line commment|single-line]] or '''multi-line'''
[[C-style comment|C-style comments]] can be either [[C-style single line comment|single-line]] or '''multi-line'''


Multi-line comments begin with a forward-slash then an asterisk <code>/*</code>.
Multi-line comments begin with a forward-slash then an asterisk <code>/*</code>.
Line 17: Line 17:
  * maintain formatting. */
  * maintain formatting. */
</syntaxhighlight>
</syntaxhighlight>
== Doc comments ==
See: [[Doc comment]]

Latest revision as of 08:53, 9 August 2025

C-style comments can be either single-line or multi-line

Multi-line comments begin with a forward-slash then an asterisk /*.

The comment ends with an asterisk then a forward slash */.

Example of a C-style single-line comment

edit edit source
/*
This is a multi-line comment
They start with a / then a * ...
... and end with a * then a /
*/

/* it's often convention to start each new line in
 * a multi-line comment with an asterisk (*) to
 * maintain formatting. */

See: Doc comment