• Source
    1. #include <iostream>
    2. #include <string>
    3. using namespace std;
    4.  
    5. int main() {
    6.  
    7. string a("test");
    8. wstring b(L"test w");
    9.  
    10. cout << a << endl;
    11. wcout << b << endl;
    12.  
    13. wstring c(a.begin(), a.end());
    14. wcout << c << endl;
    15.  
    16. string d(b.rbegin(), b.rend());
    17. cout << d << endl;
    18.  
    19. return 0;
    20. }