In C the operands of the token pasting operator ##
are not expanded.
You need a second level of indirection to get the expansion.
#define CAT(x, y) CAT_(x, y)
#define CAT_(x, y) x ## y
More Related Contents:
- How to pass arguments in __VA_ARGS to a 2d character array? [closed]
- Passing values to macros by for loop
- The need for parentheses in macros in C [duplicate]
- Overloading Macro on Number of Arguments
- C macros and use of arguments in parentheses
- Real-world use of X-Macros
- What’s the use of do while(0) when we define a macro? [duplicate]
- C multi-line macro: do/while(0) vs scope block [duplicate]
- __FILE__ macro shows full path
- What exactly do C include guards do?
- Array-size macro that rejects pointers
- What is “:-!!” in C code?
- Implement generic swap macro in C [duplicate]
- What are C macros useful for?
- Is there a macro definition to check the Linux kernel version?
- How big can a malloc be in C?
- Macro to count number of arguments
- Opposite of C preprocessor “stringification”
- What are the implications of the linux __user macro?
- C Macros to create strings
- Macro and function with same name
- Macro expansion and stringification: How to get the macro name (not its value) stringified using another macro?
- Incompatible pointer types passing in _Generic macro
- How to pass macro definition from “make” command line arguments (-D) to C source code?
- Equivalents to MSVC’s _countof in other compilers?
- What makes a better constant in C, a macro or an enum?
- Inline function v. Macro in C — What’s the Overhead (Memory/Speed)?
- offsetof at compile time
- What is ‘:-!!’ in C?
- Macros to create strings in C