fork(8) download
  1. #include <cstdio>
  2. #include <cwchar>
  3. #include <string>
  4.  
  5. int main()
  6. {
  7. std::string narrowstr = "narrow";
  8. std::wstring widestr = L"wide";
  9. printf("1 %s \n", narrowstr.c_str());
  10. printf("2 %ls \n", widestr.c_str());
  11. wprintf(L"3 %hs \n", narrowstr.c_str());
  12. wprintf(L"4 %s \n", widestr.c_str());
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
1 narrow 
2 wide