fork(1) download
  1. #define TO_STR__(...) #__VA_ARGS__
  2. #define TO_STR_(...) TO_STR__(__VA_ARGS__)
  3. #define TO_STR(...) TO_STR_(__VA_ARGS__)
  4.  
  5. #include <iostream>
  6. int main()
  7. {
  8. std::cout << "String from #include <string>, ";
  9. static const char* str = TO_STR(
  10. #include <string>
  11. );
  12.  
  13. std::cout << sizeof(str) / sizeof(char) << " characters:\n\n";
  14. std::cout << str << "\n";
  15. }
  16.  
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
String from #include <string>, 4 characters: