fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. #define intgr 12
  5. #define bnry 0b00000001
  6. #define hex 0x0A
  7. #define str "Hello World"
  8.  
  9. #define STRING(x) #x
  10. #define STRINGIZE(x) STRING(x)
  11.  
  12. int main(void) {
  13. string str_intgr = STRINGIZE(intgr);
  14. string str_bnry = STRINGIZE(bnry);
  15. string str_hex = STRINGIZE(hex);
  16. string str_str = STRINGIZE(str);
  17.  
  18. cout << str_intgr << endl;
  19. cout << str_bnry << endl;
  20. cout << str_hex << endl;
  21. cout << str_str << endl;
  22.  
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0.01s 5508KB
stdin
Standard input is empty
stdout
12
0b00000001
0x0A
"Hello World"