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/c/comment.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,21 +14,21 @@ Comments serve as a sort of in-code documentation. When inserted into a program,
14
14
1) Often known as "C-style" or "multi-line" comments.
15
15
2) Often known as "C++-style" or "single-line" comments.
16
16
17
-
All comments are removed from the program at <DocLinksrc="/c/language/translation_phases">translation phase 3</DocLink> by replacing each comment with a single whitespace character.
17
+
All comments are removed from the program at <DocLinkdest="/c/language/translation_phases">translation phase 3</DocLink> by replacing each comment with a single whitespace character.
18
18
19
19
### C-style
20
20
21
21
C-style comments are usually used to comment large blocks of text or small fragments of code; however, they can be used to comment single lines. To insert text as a C-style comment, simply surround the text with `/*` and `*/`. C-style comments tell the compiler to ignore all content between `/*` and `*/`. Although it is not part of the C standard, `/**` and `**/` are often used to indicate documentation blocks; this is legal because the second asterisk is simply treated as part of the comment.
22
22
23
-
Except within a <DocLinksrc="/c/language/character_constant">character constant</DocLink>, a <DocLinksrc="/c/language/string_literal">string literal</DocLink>, or a comment, the characters `/*` introduce a comment. The contents of such a comment are examined only to identify multibyte characters and to find the characters `*/` that terminate the comment. C-style comments cannot be nested.
23
+
Except within a <DocLinkdest="/c/language/character_constant">character constant</DocLink>, a <DocLinkdest="/c/language/string_literal">string literal</DocLink>, or a comment, the characters `/*` introduce a comment. The contents of such a comment are examined only to identify multibyte characters and to find the characters `*/` that terminate the comment. C-style comments cannot be nested.
24
24
25
25
<RevisionBlocksince="C99">
26
26
27
27
### C++-style
28
28
29
29
C++-style comments are usually used to comment single lines of text or code; however, they can be placed together to form multi-line comments. To insert text as a C++-style comment, simply precede the text with `//` and follow the text with the new line character. C++-style comments tell the compiler to ignore all content between `//` and a new line.
30
30
31
-
Except within a <DocLinksrc="/c/language/character_constant">character constant</DocLink>, a <DocLinksrc="/c/language/string_literal">string literal</DocLink>, or a comment, the characters `//` introduce a comment that includes all multibyte characters up to, but not including, the next new-line character. The contents of such a comment are examined only to identify multibyte characters and to find the new-line character that terminates the comment. C++-style comments can be nested:
31
+
Except within a <DocLinkdest="/c/language/character_constant">character constant</DocLink>, a <DocLinkdest="/c/language/string_literal">string literal</DocLink>, or a comment, the characters `//` introduce a comment that includes all multibyte characters up to, but not including, the next new-line character. The contents of such a comment are examined only to identify multibyte characters and to find the new-line character that terminates the comment. C++-style comments can be nested:
32
32
33
33
```c
34
34
// y = f(x); // invoke algorithm
@@ -53,7 +53,7 @@ A C++-style comment may appear within a C-style comment; this is a mechanism for
53
53
54
54
### Notes
55
55
56
-
Because comments <DocLinksrc="/c/language/translation_phases">are removed</DocLink> before the preprocessor stage, a macro cannot be used to form a comment and an unterminated C-style comment doesn't spill over from an #include'd file.
56
+
Because comments <DocLinkdest="/c/language/translation_phases">are removed</DocLink> before the preprocessor stage, a macro cannot be used to form a comment and an unterminated C-style comment doesn't spill over from an #include'd file.
57
57
58
58
```c
59
59
/* An attempt to use a macro to form a comment. */
@@ -151,6 +151,6 @@ Hello, again
151
151
152
152
<DescList>
153
153
<Desc>
154
-
<DocLinkslot="item"src="/cpp/comments">C++ documentation</DocLink> for <span>Comments</span>
154
+
<DocLinkslot="item"dest="/cpp/comments">C++ documentation</DocLink> for <span>Comments</span>
Copy file name to clipboardExpand all lines: src/content/docs/c/language/basic_concepts.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,12 @@ import DocLink from "@components/DocLink.astro";
12
12
13
13
This section provides definitions for the specific terminology and the concepts used when describing the C programming language.
14
14
15
-
A C program is a sequence of text files (typically header and source files) that contain <DocLinksrc="/c/language/declarations">declarations</DocLink>. They undergo <DocLinksrc="/c/language/translation_phases">translation</DocLink> to become an executable program, which is executed when the OS calls its <DocLinksrc="/c/language/main_function">main function</DocLink> (unless it is itself the OS or another *freestanding* program, in which case the entry point is implementation-defined).
15
+
A C program is a sequence of text files (typically header and source files) that contain <DocLinkdest="/c/language/declarations">declarations</DocLink>. They undergo <DocLinkdest="/c/language/translation_phases">translation</DocLink> to become an executable program, which is executed when the OS calls its <DocLinkdest="/c/language/main_function">main function</DocLink> (unless it is itself the OS or another *freestanding* program, in which case the entry point is implementation-defined).
16
16
17
-
Certain words in a C program have special meaning, they are <DocLinksrc="/c/keyword">keywords</DocLink>. Others can be used as <DocLinksrc="/c/language/identifier">identifiers</DocLink>, which may be used to identify <DocLinksrc="/c/language/object">objects</DocLink>, <DocLinksrc="/c/language/functions">functions</DocLink>, <DocLinksrc="/c/language/struct">struct</DocLink>, <DocLinksrc="/c/language/union">union</DocLink>, or <DocLinksrc="/c/language/enum">enumeration</DocLink> tags, their members, <DocLinksrc="/c/language/typedef">typedef</DocLink> names, <DocLinksrc="/c/language/statements">labels</DocLink>, or <DocLinksrc="/c/preprocessor/replace">macros</DocLink>.
17
+
Certain words in a C program have special meaning, they are <DocLinkdest="/c/keyword">keywords</DocLink>. Others can be used as <DocLinkdest="/c/language/identifier">identifiers</DocLink>, which may be used to identify <DocLinkdest="/c/language/object">objects</DocLink>, <DocLinkdest="/c/language/functions">functions</DocLink>, <DocLinkdest="/c/language/struct">struct</DocLink>, <DocLinkdest="/c/language/union">union</DocLink>, or <DocLinkdest="/c/language/enum">enumeration</DocLink> tags, their members, <DocLinkdest="/c/language/typedef">typedef</DocLink> names, <DocLinkdest="/c/language/statements">labels</DocLink>, or <DocLinkdest="/c/preprocessor/replace">macros</DocLink>.
18
18
19
-
Each identifier (other than macro) is only valid within a part of the program called its <DocLinksrc="/c/language/scope">scope</DocLink> and belongs to one of four kinds of <DocLinksrc="/c/language/name_space">name spaces</DocLink>. Some identifiers have <DocLinksrc="/c/language/storage_duration">linkage</DocLink> which makes them refer to the same entities when they appear in different scopes or translation units.
19
+
Each identifier (other than macro) is only valid within a part of the program called its <DocLinkdest="/c/language/scope">scope</DocLink> and belongs to one of four kinds of <DocLinkdest="/c/language/name_space">name spaces</DocLink>. Some identifiers have <DocLinkdest="/c/language/storage_duration">linkage</DocLink> which makes them refer to the same entities when they appear in different scopes or translation units.
20
20
21
-
Definitions of functions include sequences of <DocLinksrc="/c/language/statements">statements</DocLink> and <DocLinksrc="/c/language/declarations">declarations</DocLink>, some of which include <DocLinksrc="/c/language/expressions">expressions</DocLink>, which specify the computations to be performed by the program.
21
+
Definitions of functions include sequences of <DocLinkdest="/c/language/statements">statements</DocLink> and <DocLinkdest="/c/language/declarations">declarations</DocLink>, some of which include <DocLinkdest="/c/language/expressions">expressions</DocLink>, which specify the computations to be performed by the program.
22
22
23
-
<DocLinksrc="/c/language/declarations">Declarations</DocLink> and <DocLinksrc="/c/language/expressions">expressions</DocLink> create, destroy, access, and manipulate <DocLinksrc="/c/language/object">objects</DocLink>. Each <DocLinksrc="/c/language/object">object</DocLink>, <DocLinksrc="/c/language/functions">function</DocLink>, and <DocLinksrc="/c/language/expressions">expression</DocLink> in C is associated with a <DocLinksrc="/c/language/type">type</DocLink>.
23
+
<DocLinkdest="/c/language/declarations">Declarations</DocLink> and <DocLinkdest="/c/language/expressions">expressions</DocLink> create, destroy, access, and manipulate <DocLinkdest="/c/language/object">objects</DocLink>. Each <DocLinkdest="/c/language/object">object</DocLink>, <DocLinkdest="/c/language/functions">function</DocLink>, and <DocLinkdest="/c/language/expressions">expression</DocLink> in C is associated with a <DocLinkdest="/c/language/type">type</DocLink>.
0 commit comments