Skip to content

Commit 5864d96

Browse files
authored
Merge pull request #4760 from MicrosoftDocs/main
1/25 AM Publish
2 parents 70188d2 + ec6e9b1 commit 5864d96

File tree

82 files changed

+1104
-1134
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1104
-1134
lines changed

docs/assembler/inline/asm.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ ms.assetid: 77ff3bc9-a492-4b5e-85e1-fa4e414e79cd
1010

1111
**Microsoft Specific**
1212

13-
The **`__asm`** keyword invokes the inline assembler and can appear wherever a C or C++ statement is legal. It cannot appear by itself. It must be followed by an assembly instruction, a group of instructions enclosed in braces, or, at the very least, an empty pair of braces. The term "**`__asm`** block" here refers to any instruction or group of instructions, whether or not in braces.
13+
The **`__asm`** keyword invokes the inline assembler and can appear wherever a C or C++ statement is legal. It can't appear by itself. It must be followed by an assembly instruction, a group of instructions enclosed in braces, or, at minimum, an empty pair of braces. The term "**`__asm`** block" here refers to any instruction or group of instructions, whether or not in braces.
1414

1515
> [!NOTE]
1616
> Visual C++ support for the Standard C++ **`asm`** keyword is limited to the fact that the compiler will not generate an error on the keyword. However, an **`asm`** block will not generate any meaningful code. Use **`__asm`** instead of **`asm`**.
1717
1818
## Grammar
1919

20-
*asm-block*:<br/>
21-
&nbsp;&nbsp;&nbsp;&nbsp;**`__asm`** *assembly-instruction* **`;`**<sub>opt</sub><br/>
22-
&nbsp;&nbsp;&nbsp;&nbsp;**`__asm {`** *assembly-instruction-list* **`}`** **`;`**<sub>opt</sub>
20+
*asm-block*:\
21+
&emsp;**`__asm`** *assembly-instruction* **`;`**<sub>opt</sub>\
22+
&emsp;**`__asm {`** *assembly-instruction-list* **`}`** **`;`**<sub>opt</sub>
2323

24-
*assembly-instruction-list*:<br/>
25-
&nbsp;&nbsp;&nbsp;&nbsp;*assembly-instruction* **`;`**<sub>opt</sub><br/>
26-
&nbsp;&nbsp;&nbsp;&nbsp;*assembly-instruction* **`;`** *assembly-instruction-list* **`;`**<sub>opt</sub>
24+
*assembly-instruction-list*:\
25+
&emsp;*assembly-instruction* **`;`**<sub>opt</sub>\
26+
&emsp;*assembly-instruction* **`;`** *assembly-instruction-list* **`;`**<sub>opt</sub>
2727

2828
## Remarks
2929

@@ -37,7 +37,7 @@ Before Visual Studio 2005, the instruction
3737
__asm int 3
3838
```
3939

40-
did not cause native code to be generated when compiled with **/clr**; the compiler translated the instruction to a CLR break instruction.
40+
didn't cause native code to be generated when compiled with **/clr**; the compiler translated the instruction to a CLR break instruction.
4141

4242
`__asm int 3` now results in native code generation for the function. If you want a function to cause a break point in your code and if you want that function compiled to MSIL, use [__debugbreak](../../intrinsics/debugbreak.md).
4343

@@ -69,9 +69,9 @@ Because the **`__asm`** keyword is a statement separator, you can also put assem
6969
__asm mov al, 2 __asm mov dx, 0xD007 __asm out dx, al
7070
```
7171

72-
All three examples generate the same code, but the first style (enclosing the **`__asm`** block in braces) has some advantages. The braces clearly separate assembly code from C or C++ code and avoid needless repetition of the **`__asm`** keyword. Braces can also prevent ambiguities. If you want to put a C or C++ statement on the same line as an **`__asm`** block, you must enclose the block in braces. Without the braces, the compiler cannot tell where assembly code stops and C or C++ statements begin. Finally, because the text in braces has the same format as ordinary MASM text, you can easily cut and paste text from existing MASM source files.
72+
All three examples generate the same code, but the first style (enclosing the **`__asm`** block in braces) has some advantages. The braces clearly separate assembly code from C or C++ code and avoid needless repetition of the **`__asm`** keyword. Braces can also prevent ambiguities. If you want to put a C or C++ statement on the same line as an **`__asm`** block, you must enclose the block in braces. Without the braces, the compiler can't tell where assembly code stops and C or C++ statements begin. Finally, because the text in braces has the same format as ordinary MASM text, you can easily cut and paste text from existing MASM source files.
7373

74-
Unlike braces in C and C++, the braces enclosing an **`__asm`** block don't affect variable scope. You can also nest **`__asm`** blocks; nesting does not affect variable scope.
74+
Unlike braces in C and C++, the braces enclosing an **`__asm`** block don't affect variable scope. You can also nest **`__asm`** blocks; nesting doesn't affect variable scope.
7575

7676
**END Microsoft Specific**
7777

docs/c-language/array-declarations.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,38 @@ An "array declaration" names the array and specifies the type of its elements. I
1111

1212
## Syntax
1313

14-
*declaration*:<br/>
15-
&nbsp;&nbsp;&nbsp;&nbsp;*declaration-specifiers* *init-declarator-list*<sub>opt</sub> **;**
14+
*`declaration`*:\
15+
&emsp;*`declaration-specifiers`* *`init-declarator-list`*<sub>opt</sub> **`;`**
1616

17-
*init-declarator-list*:<br/>
18-
&nbsp;&nbsp;&nbsp;&nbsp;*init-declarator*<br/>
19-
&nbsp;&nbsp;&nbsp;&nbsp;*init-declarator-list* **,** *init-declarator*
17+
*`init-declarator-list`*:\
18+
&emsp;*`init-declarator`*\
19+
&emsp;*`init-declarator-list`* **`,`** *`init-declarator`*
2020

21-
*init-declarator*:<br/>
22-
&nbsp;&nbsp;&nbsp;&nbsp;*declarator*<br/>
23-
&nbsp;&nbsp;&nbsp;&nbsp;*declarator* **=** *initializer*
21+
*`init-declarator`*:\
22+
&emsp;*`declarator`*\
23+
&emsp;*`declarator`* **`=`** *`initializer`*
2424

25-
*declarator*:<br/>
26-
&nbsp;&nbsp;&nbsp;&nbsp;*pointer*<sub>opt</sub> *direct-declarator*
25+
*`declarator`*:\
26+
&emsp;*`pointer`*<sub>opt</sub> *`direct-declarator`*
2727

28-
*direct-declarator*: /\* A function declarator \*/<br/>
29-
&nbsp;&nbsp;&nbsp;&nbsp;*direct-declarator* **[** *constant-expression*<sub>opt</sub> **]**
28+
*`direct-declarator`*: /\* A function declarator \*/\
29+
&emsp;*`direct-declarator`* **`[`** *`constant-expression`*<sub>opt</sub> **`]`**
3030

31-
Because *constant-expression* is optional, the syntax has two forms:
31+
Because *`constant-expression`* is optional, the syntax has two forms:
3232

33-
- The first form defines an array variable. The *constant-expression* argument within the brackets specifies the number of elements in the array. The *constant-expression*, if present, must have integral type, and a value larger than zero. Each element has the type given by *type-specifier*, which can be any type except **`void`**. An array element cannot be a function type.
33+
- The first form defines an array variable. The *`constant-expression`* argument within the brackets specifies the number of elements in the array. The *`constant-expression`*, if present, must have integral type, and a value larger than zero. Each element has the type given by *`type-specifier`*, which can be any type except **`void`**. An array element can't be a function type.
3434

35-
- The second form declares a variable that has been defined elsewhere. It omits the *constant-expression* argument in brackets, but not the brackets. You can use this form only if you previously have initialized the array, declared it as a parameter, or declared it as a reference to an array explicitly defined elsewhere in the program.
35+
- The second form declares a variable that has been defined elsewhere. It omits the *`constant-expression`* argument in brackets, but not the brackets. You can use this form only if you've previously initialized the array, declared it as a parameter, or declared it as a reference to an array that's explicitly defined elsewhere in the program.
3636

37-
In both forms, *direct-declarator* names the variable and can modify the variable's type. The brackets (**[ ]**) following *direct-declarator* modify the declarator to an array type.
37+
In both forms, *`direct-declarator`* names the variable and can modify the variable's type. The brackets (**`[ ]`**) following *`direct-declarator`* modify the declarator to an array type.
3838

3939
Type qualifiers can appear in the declaration of an object of array type, but the qualifiers apply to the elements rather than the array itself.
4040

4141
You can declare an array of arrays (a "multidimensional" array) by following the array declarator with a list of bracketed constant expressions in this form:
4242

43-
> *type-specifier* *declarator* **[** *constant-expression* **]** **[** *constant-expression* **]** ...
43+
> *`type-specifier`* *`declarator`* **`[`** *`constant-expression`* **`]`** **`[`** *`constant-expression`* **`]`** ...
4444
45-
Each *constant-expression* in brackets defines the number of elements in a given dimension: two-dimensional arrays have two bracketed expressions, three-dimensional arrays have three, and so on. You can omit the first constant expression if you have initialized the array, declared it as a parameter, or declared it as a reference to an array explicitly defined elsewhere in the program.
45+
Each *`constant-expression`* in brackets defines the number of elements in a given dimension: two-dimensional arrays have two bracketed expressions, three-dimensional arrays have three, and so on. You can omit the first constant expression if you've initialized the array, declared it as a parameter, or declared it as a reference to an array explicitly defined elsewhere in the program.
4646

4747
You can define arrays of pointers to various types of objects by using complex declarators, as described in [Interpreting More Complex Declarators](../c-language/interpreting-more-complex-declarators.md).
4848

@@ -52,7 +52,7 @@ Arrays are stored by row. For example, the following array consists of two rows
5252
char A[2][3];
5353
```
5454

55-
The three columns of the first row are stored first, followed by the three columns of the second row. This means that the last subscript varies most quickly.
55+
The three columns of the first row are stored first, followed by the three columns of the second row. It means that the last subscript varies most quickly.
5656

5757
To refer to an individual element of an array, use a subscript expression, as described in [Postfix Operators](../c-language/postfix-operators.md).
5858

@@ -72,7 +72,7 @@ struct {
7272
} complex[100];
7373
```
7474

75-
This is a declaration of an array of structures. This array has 100 elements; each element is a structure containing two members.
75+
This example is a declaration of an array of structures. This array has 100 elements; each element is a structure containing two members.
7676

7777
```C
7878
extern char *name[];
@@ -82,7 +82,7 @@ This statement declares the type and name of an array of pointers to **`char`**.
8282

8383
**Microsoft Specific**
8484

85-
The type of integer required to hold the maximum size of an array is the size of **size_t**. Defined in the header file STDDEF.H, **size_t** is an **`unsigned int`** with the range 0x00000000 to 0x7CFFFFFF.
85+
The type of integer required to hold the maximum size of an array is the size of **`size_t`**.
8686

8787
**END Microsoft Specific**
8888

docs/c-language/bitwise-shift-operators.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ The shift operators shift their first operand left (**`<<`**) or right (**`>>`**
1111

1212
## Syntax
1313

14-
*shift-expression*:<br/>
15-
&nbsp;&nbsp;&nbsp;&nbsp;*additive-expression*<br/>
16-
&nbsp;&nbsp;&nbsp;&nbsp;*shift-expression* **`<<`** *additive-expression*<br/>
17-
&nbsp;&nbsp;&nbsp;&nbsp;*shift-expression* **`>>`** *additive-expression*
14+
*`shift-expression`*:\
15+
&emsp;*`additive-expression`*\
16+
&emsp;*`shift-expression`* **`<<`** *`additive-expression`*\
17+
&emsp;*`shift-expression`* **`>>`** *`additive-expression`*
1818

1919
Both operands must be integral values. These operators perform the usual arithmetic conversions; the type of the result is the type of the left operand after conversion.
2020

21-
For leftward shifts, the vacated right bits are set to 0. For rightward shifts, the vacated left bits are filled based on the type of the first operand after conversion. If the type is **`unsigned`**, they are set to 0. Otherwise, they are filled with copies of the sign bit. For left-shift operators without overflow, the statement
21+
For leftward shifts, the vacated right bits are set to 0. For rightward shifts, the vacated left bits are filled based on the type of the first operand after conversion. If the type is **`unsigned`**, they're set to 0. Otherwise, they're filled with copies of the sign bit. For left-shift operators without overflow, the statement
2222

2323
```C
2424
expr1 << expr2
@@ -34,7 +34,7 @@ is equivalent to division by 2<sup>expr2</sup> if `expr1` is unsigned or has a n
3434

3535
The result of a shift operation is undefined if the second operand is negative, or if the right operand is greater than or equal to the width in bits of the promoted left operand.
3636

37-
Since the conversions performed by the shift operators do not provide for overflow or underflow conditions, information may be lost if the result of a shift operation cannot be represented in the type of the first operand after conversion.
37+
Since the conversions performed by the shift operators don't provide for overflow or underflow conditions, information may be lost if the result of a shift operation can't be represented in the type of the first operand after conversion.
3838

3939
```C
4040
unsigned int x, y, z;

docs/c-language/break-statement-c.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ The **`break`** statement terminates the execution of the nearest enclosing **`d
1212

1313
## Syntax
1414

15-
*jump-statement*:<br/>
16-
&nbsp;&nbsp;&nbsp;&nbsp;**break ;**
15+
*`jump-statement`*:\
16+
&emsp;**`break ;`**
1717

1818
The **`break`** statement is frequently used to terminate the processing of a particular case within a **`switch`** statement. Lack of an enclosing iterative or **`switch`** statement generates an error.
1919

docs/c-language/c-abstract-declarators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.assetid: 6a556ad7-0555-421a-aa02-294d77cda8b5
77
---
88
# C Abstract Declarators
99

10-
An abstract declarator is a declarator without an identifier, consisting of one or more pointer, array, or function modifiers. The pointer modifier (<strong>\*</strong>) always precedes the identifier in a declarator; array (**[ ]**) and function ( **( )** ) modifiers follow the identifier. Knowing this, you can determine where the identifier would appear in an abstract declarator and interpret the declarator accordingly. See [Interpreting More Complex Declarators](../c-language/interpreting-more-complex-declarators.md) for additional information and examples of complex declarators. Generally **`typedef`** can be used to simplify declarators. See [Typedef Declarations](../c-language/typedef-declarations.md).
10+
An abstract declarator is a declarator without an identifier, consisting of one or more pointer, array, or function modifiers. The pointer modifier (**`*`**) always precedes the identifier in a declarator; array (**[ ]**) and function ( **( )** ) modifiers follow the identifier. Knowing this, you can determine where the identifier would appear in an abstract declarator and interpret the declarator accordingly. See [Interpreting More Complex Declarators](../c-language/interpreting-more-complex-declarators.md) for additional information and examples of complex declarators. Generally **`typedef`** can be used to simplify declarators. See [Typedef Declarations](../c-language/typedef-declarations.md).
1111

1212
Abstract declarators can be complex. Parentheses in a complex abstract declarator specify a particular interpretation, just as they do for the complex declarators in declarations.
1313

docs/c-language/c-additive-operators.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ ms.assetid: bb8ac205-b061-41fc-8dd4-dab87c8b900c
77
---
88
# C Additive Operators
99

10-
The additive operators perform addition (**+**) and subtraction (**-**).
10+
The additive operators perform addition (**`+`**) and subtraction (**`-`**).
1111

1212
## Syntax
1313

14-
*additive-expression*:<br/>
15-
&nbsp;&nbsp;&nbsp;&nbsp;*multiplicative-expression*<br/>
16-
&nbsp;&nbsp;&nbsp;&nbsp;*additive-expression* **+** *multiplicative-expression*<br/>
17-
&nbsp;&nbsp;&nbsp;&nbsp;*additive-expression* **-** *multiplicative-expression*
14+
*`additive-expression`*:\
15+
&emsp;*`multiplicative-expression`*\
16+
&emsp;*`additive-expression`* **`+`** *`multiplicative-expression`*\
17+
&emsp;*`additive-expression`* **`-`** *`multiplicative-expression`*
1818

1919
> [!NOTE]
20-
> Although the syntax for *additive-expression* includes *multiplicative-expression*, this does not imply that expressions using multiplication are required. See the syntax in [C Language Syntax Summary](../c-language/c-language-syntax-summary.md), for *multiplicative-expression*, *cast-expression*, and *unary-expression*.
20+
> Although the syntax for *`additive-expression`* includes *`multiplicative-expression`*, this does not imply that expressions using multiplication are required. See the syntax in [C Language Syntax Summary](../c-language/c-language-syntax-summary.md), for *`multiplicative-expression`*, *cast-expression*, and *unary-expression*.
2121
2222
The operands can be integral or floating values. Some additive operations can also be performed on pointer values, as outlined under the discussion of each operator.
2323

24-
The additive operators perform the usual arithmetic conversions on integral and floating operands. The type of the result is the type of the operands after conversion. Since the conversions performed by the additive operators do not provide for overflow or underflow conditions, information may be lost if the result of an additive operation cannot be represented in the type of the operands after conversion.
24+
The additive operators perform the usual arithmetic conversions on integral and floating operands. The type of the result is the type of the operands after conversion. Since the conversions performed by the additive operators don't provide for overflow or underflow conditions, information may be lost if the result of an additive operation isn't representable in the type of the operands after conversion.
2525

2626
## See also
2727

28-
[Additive Operators: + and -](../cpp/additive-operators-plus-and.md)
28+
[Additive Operators: `+` and `-`](../cpp/additive-operators-plus-and.md)

docs/c-language/c-assignment-operators.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,32 @@ ms.assetid: 11688dcb-c941-44e7-a636-3fc98e7dac40
77
---
88
# C Assignment Operators
99

10-
An assignment operation assigns the value of the right-hand operand to the storage location named by the left-hand operand. Therefore, the left-hand operand of an assignment operation must be a modifiable l-value. After the assignment, an assignment expression has the value of the left operand but is not an l-value.
10+
An assignment operation assigns the value of the right-hand operand to the storage location named by the left-hand operand. Therefore, the left-hand operand of an assignment operation must be a modifiable l-value. After the assignment, an assignment expression has the value of the left operand but isn't an l-value.
1111

1212
## Syntax
1313

1414
*`assignment-expression`*:\
1515
&emsp;*`conditional-expression`*\
1616
&emsp;*`unary-expression`* *`assignment-operator`* *`assignment-expression`*
1717

18-
*`assignment-operator`*: one of<br/>
18+
*`assignment-operator`*: one of\
1919
&emsp;**`=`** **`*=`** **`/=`** **`%=`** **`+=`** **`-=`** **`<<=`** **`>>=`** **`&=`** **`^=`** **`|=`**
2020

2121
The assignment operators in C can both transform and assign values in a single operation. C provides the following assignment operators:
2222

23-
|Operator|Operation Performed|
24-
|--------------|-------------------------|
25-
|**`=`**|Simple assignment|
26-
|**`*=`**|Multiplication assignment|
27-
|**`/=`**|Division assignment|
28-
|**`%=`**|Remainder assignment|
29-
|**`+=`**|Addition assignment|
30-
|**`-=`**|Subtraction assignment|
31-
|**`<<=`**|Left-shift assignment|
32-
|**`>>=`**|Right-shift assignment|
33-
|**`&=`**|Bitwise-AND assignment|
34-
|**`^=`**|Bitwise-exclusive-OR assignment|
35-
|**`|=`**|Bitwise-inclusive-OR assignment|
23+
| Operator | Operation Performed |
24+
|---|---|
25+
| **`=`** | Simple assignment |
26+
| **`*=`** | Multiplication assignment |
27+
| **`/=`** | Division assignment |
28+
| **`%=`** | Remainder assignment |
29+
| **`+=`** | Addition assignment |
30+
| **`-=`** | Subtraction assignment |
31+
| **`<<=`** | Left-shift assignment |
32+
| **`>>=`** | Right-shift assignment |
33+
| **`&=`** | Bitwise-AND assignment |
34+
| **`^=`** | Bitwise-exclusive-OR assignment |
35+
| **` | =`** | Bitwise-inclusive-OR assignment |
3636

3737
In assignment, the type of the right-hand value is converted to the type of the left-hand value, and the value is stored in the left operand after the assignment has taken place. The left operand must not be an array, a function, or a constant. The specific conversion path, which depends on the two types, is outlined in detail in [Type Conversions](../c-language/type-conversions-c.md).
3838

0 commit comments

Comments
 (0)