Skip to content

Commit e9689f5

Browse files
authored
Merge pull request #5761 from MicrosoftDocs/FromPublicMasterBranch
Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main)
2 parents 6bb9ad3 + 3766297 commit e9689f5

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
---
2-
description: "Learn more about: Compiler Error C2153"
32
title: "Compiler Error C2153"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2153"
4+
ms.date: "01/31/2025"
55
f1_keywords: ["C2153"]
66
helpviewer_keywords: ["C2153"]
7-
ms.assetid: cfc50cb7-9a0f-4b5b-879a-d419c99f7be1
87
---
98
# Compiler Error C2153
109

11-
hex constants must have at least one hex digit
10+
integer literals must have at least one digit
1211

13-
Hexadecimal constants 0x, 0X, and \x are not valid. At least one hex digit must follow x or X.
12+
Hexadecimal and binary literals must contain at least one digit after the leading sequence (`0x`, `0X`, `0b`, or `0B`), otherwise the trailing character may be incorrectly interpreted as a suffix or literal operator. See [Integer literals](../../cpp/numeric-boolean-and-pointer-literals-cpp.md#integer-literals) for more information.
1413

1514
The following sample generates C2153:
1615

1716
```cpp
1817
// C2153.cpp
19-
int main() {
20-
int a= 0x; // C2153
21-
int b= 0xA; // OK
18+
int main()
19+
{
20+
int a = 0x; // C2153
21+
int b = 0x0; // OK
22+
23+
int c = 0b; // C2153
24+
int d = 0b0; // OK
2225
}
2326
```

0 commit comments

Comments
 (0)