Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. // Makes a string of the argument (which is not macro-expanded)
  2. #define STR(a) #a
  3.  
  4. // Makes a string of the macro expansion of a
  5. #define XSTR(a) STR(a)
  6.  
  7. STR(MyClass);
  8.  
  9. "MyClass";
  10.  
  11. #define a value_a
  12.  
  13. printf("%s", XSTR(a));
  14.  
  15. string s = STR("my quoted string");
  16. cout << s;
  17.  
  18. "my quoted string"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement