fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <sstream>
  4.  
  5. int main(int argc, char* argv[])
  6. {
  7. std::wstringstream wss;
  8. int i = 42;
  9. wss << i;
  10.  
  11. std::wstring str = wss.str();
  12. std::wcout << str.c_str() << std::endl;
  13.  
  14. std::wstring str2 = std::to_wstring(i);
  15. std::wcout << str2.c_str() << std::endl;
  16.  
  17. std::cin.get();
  18. return 0;
  19. }
Success #stdin #stdout 0s 3052KB
stdin
Standard input is empty
stdout
42
42