Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Makes a string of the argument (which is not macro-expanded)
- #define STR(a) #a
- // Makes a string of the macro expansion of a
- #define XSTR(a) STR(a)
- STR(MyClass);
- "MyClass";
- #define a value_a
- printf("%s", XSTR(a));
- string s = STR("my quoted string");
- cout << s;
- "my quoted string"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement