Use the preprocessor #
operator:
#define CALL_DO_SOMETHING(VAR) do_something(#VAR, VAR);
More Related Contents:
- C/C++, can you #include a file into a string literal? [duplicate]
- Concat two `const char` string literals
- What is the difference between #include and #include “filename”?
- Why use apparently meaningless do-while and if-else statements in macros?
- C++ preprocessor __VA_ARGS__ number of arguments
- Unicode encoding for string literals in C++11
- Can we have recursive macros?
- When are C++ macros beneficial? [closed]
- Computing length of a C string at compile time. Is this really a constexpr?
- C/C++ line number
- Error: invalid operands of types ‘const char [35]’ and ‘const char [2]’ to binary ‘operator+’
- How to identify platform/compiler from preprocessor macros?
- Common array length macro for C? [duplicate]
- Can you make custom operators in C++?
- Portability of #warning preprocessor directive
- How to make G++ preprocessor output a newline in a macro?
- C/C++ macro/template blackmagic to generate unique name
- Can the C preprocessor be used to tell if a file exists?
- Difference between Enum and Define Statements
- String literals not allowed as non type template parameters
- macro definition containing #include directive
- What does “#define STR(a) #a” do?
- C++: Can a macro expand “abc” into ‘a’, ‘b’, ‘c’?
- GCC, stringification, and inline GLSL?
- “No newline at end of file” compiler warning
- Header file included only once in entire program?
- Confused by squaring macro SQR in c [duplicate]
- C++ #include semantics
- Is there a way to do a #define inside of another #define?
- How do I run the preprocessor on local headers only?