#include <iostream> #include <plug/plug.h> using namespace std; //使用宽字符,我猜是为了适应那些要使用宽字符的国家 int main() { auto path = Plug::GetCurrentPath();//返回std::wstring宽字符 std::wstring line; path += L"hello.txt";//L表示宽字符 std::wifstream wif(path); wif >> line; auto str = Plug::wcstombs(line);//由std::wstring转换std::string std::cout << str.c_str(); wif.close(); system("pause"); }
流继承关系图: