wostream fails to output wstring

前端 未结 2 2049
甜味超标
甜味超标 2020-12-16 06:34

I am using Visual Studio C++ 2008 (Express). When I run the below code, the wostream (both std::wcout, and std::wfstream) stops outputting at the f

2条回答
  •  盖世英雄少女心
    2020-12-16 07:00

    Include the following header file

    #include 
    

    at the start of main, add the following line.

    std::locale::global(std::locale("chinese"));
    

    This helps to set the proper locale.

提交回复
热议问题