The /**/ operator differs from the ## operator only in the way that the preprocessor treats white space between the operator and its arguments.
For example, the macro definition:
#define XY(x, y) x /**/y
does not give the same result as:
#define XY(x, y) x ##y
because the preprocessor preserves white space with the /**/ operator. With the ## operator, arguments are concatenated without white space.
The following examples demonstrate the use of the /**/ operator:
| Sample Preprocessor Macro Definitions | |
| #define
ws1(x, y) x /**/y #define ws2(x, y) x/**/ y #define nws1(x, y) x ##y #define nws2(x, y) x##y |
|
| Invocation | Result of Macro Expansion |
|---|---|
| ws1(Turtle, neck) | Turtle neck |
| ws2(Turtle, neck) | Turtle neck |
| nws1(Turtle, neck) | Turtleneck |
| nws2(Turtle, neck) | Turtleneck |
For /**/ to function the same way as ## in ANSI/ISO C, there can be no spaces between the operator and the arguments.
![]()
Preprocessor
Directives
Preprocessor
Macros
![]()
Preprocessor Macro
Operators
#define Preprocessor
Directive