Skip to content

Commit 903284e

Browse files
authored
Stringizing operator code example was misplaced
1 parent a52ff28 commit 903284e

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

docs/preprocessor/stringizing-operator-hash.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ The Visual C++ stringizing operator does not behave correctly when it is used wi
2222

2323
The following example shows a macro definition that includes the stringizing operator and a main function that invokes the macro:
2424

25-
Such invocations would be expanded during preprocessing, producing the following code:
26-
27-
```cpp
28-
int main() {
29-
printf_s( "In quotes in the printf function call\n" "\n" );
30-
printf_s( "\"In quotes when printed to the screen\"\n" "\n" );
31-
printf_s( "\"This: \\\" prints an escaped double quote\"" "\n" );
32-
}
33-
```
34-
3525
```cpp
3626
// stringizer.cpp
3727
#include <stdio.h>
@@ -43,6 +33,16 @@ int main() {
4333
}
4434
```
4535
36+
Such invocations would be expanded during preprocessing, producing the following code:
37+
38+
```cpp
39+
int main() {
40+
printf_s( "In quotes in the printf function call\n" "\n" );
41+
printf_s( "\"In quotes when printed to the screen\"\n" "\n" );
42+
printf_s( "\"This: \\\" prints an escaped double quote\"" "\n" );
43+
}
44+
```
45+
4646
```Output
4747
In quotes in the printf function call
4848
"In quotes when printed to the screen"
@@ -64,4 +64,4 @@ FB1(F B)
6464
6565
## See also
6666
67-
[Preprocessor Operators](../preprocessor/preprocessor-operators.md)
67+
[Preprocessor Operators](../preprocessor/preprocessor-operators.md)

0 commit comments

Comments
 (0)