Skip to content

Commit 28cddbd

Browse files
authored
Merge pull request #4970 from Rageking8/update-c2101
Update C2101
2 parents c928384 + 6d9cbb3 commit 28cddbd

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
---
22
description: "Learn more about: Compiler Error C2101"
33
title: "Compiler Error C2101"
4-
ms.date: "11/04/2016"
4+
ms.date: "03/04/2024"
55
f1_keywords: ["C2101"]
66
helpviewer_keywords: ["C2101"]
7-
ms.assetid: 42f0136f-8cc1-4f2b-be1c-721ec9278e66
87
---
98
# Compiler Error C2101
109

1110
'&' on constant
1211

13-
The address-of operator ( `&` ) must have an l-value as operand.
12+
The [address-of operator (**`&`**)](../../cpp/address-of-operator-amp.md) must have an l-value as operand.
1413

1514
The following sample generates C2101:
1615

1716
```cpp
1817
// C2101.cpp
19-
int main() {
20-
char test;
21-
test = &'a'; // C2101
22-
test = 'a'; // OK
18+
int main()
19+
{
20+
int* ptr = &123; // C2101
2321
}
2422
```

0 commit comments

Comments
 (0)