Skip to content

Commit 2528ec6

Browse files
Refactor comments section for clarity and formatting
Removed redundant numbering and improved comment syntax formatting.
1 parent d6e09cb commit 2528ec6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/content/docs/cpp/comments.mdx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,18 @@ Comments serve as a sort of in-code documentation. When inserted into a program,
1111

1212
## Syntax
1313

14+
#### Block Comment
15+
Often known as "C-style" or "multi-line" comments.
16+
1417
```
1518
/* comment */
1619
```
17-
18-
(1)
20+
#### Single-line Comment
21+
Often known as "C++-style" or "single-line" comments.
1922
```
2023
// comment
2124
```
2225

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-
2826
All comments are removed from the program at <DocLink src="/cpp/language/translation_phases">translation phase 3</DocLink> by replacing each comment with a single whitespace character.
2927

3028
## C-style
@@ -103,4 +101,4 @@ Output:
103101
<Desc>
104102
<DocLink slot="item" src="/c/comment">C documentation</DocLink> for <span>comment</span>
105103
</Desc>
106-
</DescList>
104+
</DescList>

0 commit comments

Comments
 (0)