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 11---
22description : " Learn more about: Compiler Error C2101"
33title : " Compiler Error C2101"
4- ms.date : " 11 /04/2016 "
4+ ms.date : " 03 /04/2024 "
55f1_keywords : ["C2101"]
66helpviewer_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
1514The 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```
You can’t perform that action at this time.
0 commit comments