Skip to content

Commit ad25a41

Browse files
authored
Add example for C2103
1 parent 59be1de commit ad25a41

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
---
22
description: "Learn more about: Compiler Error C2103"
33
title: "Compiler Error C2103"
4-
ms.date: "11/04/2016"
4+
ms.date: "03/04/2024"
55
f1_keywords: ["C2103"]
66
helpviewer_keywords: ["C2103"]
7-
ms.assetid: dfe95972-35e9-469a-b8a8-52c849d4e4e4
87
---
98
# Compiler Error C2103
109

1110
'&' on register variable
1211

1312
You cannot take the address of a register.
13+
14+
The following sample generates C2103:
15+
16+
```c
17+
// C2103.c
18+
int main(void)
19+
{
20+
register int x = 1;
21+
int* ptr = &x; // C2103
22+
}
23+
```

0 commit comments

Comments
 (0)