You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/cpp/comments.mdx
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,20 +11,18 @@ Comments serve as a sort of in-code documentation. When inserted into a program,
11
11
12
12
## Syntax
13
13
14
+
#### Block Comment
15
+
Often known as "C-style" or "multi-line" comments.
16
+
14
17
```
15
18
/* comment */
16
19
```
17
-
18
-
(1)
20
+
#### Single-line Comment
21
+
Often known as "C++-style" or "single-line" comments.
19
22
```
20
23
// comment
21
24
```
22
25
23
-
(2)
24
-
25
-
1) Often known as "C-style" or "multi-line" comments.
26
-
2) Often known as "C++-style" or "single-line" comments.
27
-
28
26
All comments are removed from the program at <DocLinksrc="/cpp/language/translation_phases">translation phase 3</DocLink> by replacing each comment with a single whitespace character.
29
27
30
28
## C-style
@@ -103,4 +101,4 @@ Output:
103
101
<Desc>
104
102
<DocLinkslot="item"src="/c/comment">C documentation</DocLink> for <span>comment</span>
0 commit comments