File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
docs/error-messages/compiler-errors-1 Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
description : " Learn more about: Compiler Error C2101"
3
3
title : " Compiler Error C2101"
4
- ms.date : " 11 /04/2016 "
4
+ ms.date : " 03 /04/2024 "
5
5
f1_keywords : ["C2101"]
6
6
helpviewer_keywords : ["C2101"]
7
- ms.assetid : 42f0136f-8cc1-4f2b-be1c-721ec9278e66
8
7
---
9
8
# Compiler Error C2101
10
9
11
10
'&' on constant
12
11
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.
14
13
15
14
The following sample generates C2101:
16
15
17
16
``` cpp
18
17
// 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
23
21
}
24
22
```
You can’t perform that action at this time.
0 commit comments