Skip to content

Commit 85ce5cb

Browse files
authored
Expand C2162 error page
1 parent fe00e93 commit 85ce5cb

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
---
2-
description: "Learn more about: Compiler Error C2162"
32
title: "Compiler Error C2162"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2162"
4+
ms.date: "03/30/2025"
55
f1_keywords: ["C2162"]
66
helpviewer_keywords: ["C2162"]
7-
ms.assetid: 34923628-d35e-48ab-9072-b95e3b5f6b45
87
---
98
# Compiler Error C2162
109

11-
expected macro formal parameter
10+
> expected macro formal parameter
1211
13-
The token following a stringizing operator (#) is not a formal parameter name.
12+
The token following a [stringizing operator (#)](../../preprocessor/stringizing-operator-hash.md) or a [charizing operator (#@)](../../preprocessor/charizing-operator-hash-at.md) is not a formal parameter.
1413

1514
## Example
1615

17-
The following sample generates C2162:
16+
The following example generates C2162:
1817

1918
```cpp
2019
// C2162.cpp
2120
// compile with: /c
22-
#include <stdio.h>
21+
#define make_string1(s) # // C2162
22+
#define make_string2(s) #s // OK
2323

24-
#define print(a) printf_s(b) // OK
25-
#define print(a) printf_s(#b) // C2162
24+
#define make_char1(c) #@ // C2162
25+
#define make_char2(c) #@c // OK
2626
```

docs/error-messages/compiler-errors-1/compiler-errors-c2100-through-c2199.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: Compiler errors C2100 through C2199"
32
title: "Compiler errors C2100 through C2199"
3+
description: "Learn more about: Compiler errors C2100 through C2199"
44
ms.date: "04/21/2019"
55
f1_keywords: ["C2119", "C2123", "C2125", "C2126", "C2127", "C2136", "C2176", "C2187", "C2189"]
66
helpviewer_keywords: ["C2119", "C2123", "C2125", "C2126", "C2127", "C2136", "C2176", "C2187", "C2189"]
@@ -118,5 +118,5 @@ The articles in this section of the documentation explain a subset of the error
118118

119119
## See also
120120

121-
[C/C++ Compiler and build tools errors and warnings](../compiler-errors-1/c-cpp-build-errors.md) \
122-
[Compiler errors C2001 - C3999, C7000 - C7999](../compiler-errors-1/compiler-errors-c2000-c3999.md)
121+
[C/C++ Compiler and build tools errors and warnings](c-cpp-build-errors.md)\
122+
[Compiler errors C2001 - C3999, C7000 - C7999](compiler-errors-c2000-c3999.md)

0 commit comments

Comments
 (0)