Skip to content

Commit c928384

Browse files
authored
Merge pull request #4971 from Rageking8/add-example-for-c2103
Add example for C2103
2 parents 2055c4d + 700a52c commit c928384

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
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+
```
24+
25+
> [!NOTE]
26+
> This error applies to C code.

0 commit comments

Comments
 (0)