We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c928384 + 6d9cbb3 commit 28cddbdCopy full SHA for 28cddbd
1 file changed
docs/error-messages/compiler-errors-1/compiler-error-c2101.md
@@ -1,24 +1,22 @@
1
---
2
description: "Learn more about: Compiler Error C2101"
3
title: "Compiler Error C2101"
4
-ms.date: "11/04/2016"
+ms.date: "03/04/2024"
5
f1_keywords: ["C2101"]
6
helpviewer_keywords: ["C2101"]
7
-ms.assetid: 42f0136f-8cc1-4f2b-be1c-721ec9278e66
8
9
# Compiler Error C2101
10
11
'&' on constant
12
13
-The address-of operator ( `&` ) must have an l-value as operand.
+The [address-of operator (**`&`**)](../../cpp/address-of-operator-amp.md) must have an l-value as operand.
14
15
The following sample generates C2101:
16
17
```cpp
18
// C2101.cpp
19
-int main() {
20
- char test;
21
- test = &'a'; // C2101
22
- test = 'a'; // OK
+int main()
+{
+ int* ptr = &123; // C2101
23
}
24
```
0 commit comments