Skip to content

Commit 2b194ac

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2101, C2120]
1 parent dcd4480 commit 2b194ac

18 files changed

+60
-2
lines changed

docs/error-messages/compiler-errors-1/compiler-error-c2101.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ helpviewer_keywords: ["C2101"]
99

1010
> '&' on constant
1111
12+
## Remarks
13+
1214
The [address-of operator (**`&`**)](../../cpp/address-of-operator-amp.md) must have an l-value as operand.
1315

16+
## Example
17+
1418
The following sample generates C2101:
1519

1620
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2102.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ helpviewer_keywords: ["C2102"]
99

1010
> '&' requires l-value
1111
12+
## Remarks
13+
1214
The [address-of operator (**`&`**)](../../cpp/address-of-operator-amp.md) must have an l-value as operand. Address of temporary values cannot be taken.
1315

16+
## Example
17+
1418
The following sample generates C2102:
1519

1620
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2103.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ helpviewer_keywords: ["C2103"]
99

1010
> '&' on register variable
1111
12+
## Remarks
13+
1214
You cannot take the address of a register.
1315

16+
## Example
17+
1418
The following sample generates C2103:
1519

1620
```c

docs/error-messages/compiler-errors-1/compiler-error-c2104.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 2ea78896-72a6-4901-a1fa-f33ea88ad61b
1010

1111
> '&' on bit field ignored
1212
13+
## Remarks
14+
1315
You cannot take the address of a bit field.
1416

17+
## Example
18+
1519
The following sample generates C2104:
1620

1721
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2105.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 19b7f7bc-a9da-4d23-8193-005b6d09274f
1010

1111
> 'operator' needs l-value
1212
13+
## Remarks
14+
1315
The operator must have an l-value as operand.
1416

17+
## Examples
18+
1519
The following sample generates C2105:
1620

1721
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2106.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: d5c91a2e-04e4-4770-8478-788b98c52a53
1010

1111
> 'operator' : left operand must be l-value
1212
13+
## Remarks
14+
1315
The operator must have an l-value as its left operand.
1416

17+
## Example
18+
1519
The following sample generates C2106:
1620

1721
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2107.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 2866a121-884e-4bb5-8613-36de5817000e
1010

1111
> illegal index, indirection not allowed
1212
13+
## Remarks
14+
1315
A subscript is applied to an expression that does not evaluate to a pointer.
1416

1517
## Example

docs/error-messages/compiler-errors-1/compiler-error-c2109.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 2d1ac79d-a985-4904-a38b-b270578d664d
1010

1111
> subscript requires array or pointer type
1212
13+
## Remarks
14+
1315
The subscript was used on a variable that was not an array.
1416

17+
## Example
18+
1519
The following sample generates C2109:
1620

1721
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2110.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ helpviewer_keywords: ["C2110"]
99

1010
> '+' : cannot add two pointers
1111
12+
## Remarks
13+
1214
An attempt was made to add two pointer values using the plus (`+`) operator.
1315

16+
## Example
17+
1418
The following sample generates C2110:
1519

1620
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2111.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ helpviewer_keywords: ["C2111"]
99

1010
> '+' : pointer addition requires integral operand
1111
12+
## Remarks
13+
1214
An attempt was made to add a nonintegral value to a pointer using the plus (`+`) operator.
1315

16+
## Example
17+
1418
The following sample generates C2111:
1519

1620
```cpp

0 commit comments

Comments
 (0)