c++怎么读取文件中的中文字符串的几种方法

日期:2016-09-14 15:21:00 人气:1

c++怎么读取文件中的中文字符串的几种方法

方法一: #include #include #include using namespace std; int main() { ifstream ifs("test.cpp"); // 改成你要打开的文件 streambuf* old_buffer = cin.rdbuf(ifs.rdbuf()); string read; while(cin >> read) // 逐词读取方法一
    A+
热门评论