阅读背景:

从ifstream读取一行到字符串变量。

来源:互联网 

In the following code :

在以下代码中:

#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main() {
    string x = "This is C++.";
    ofstream of("d:/tester.txt");
    of << x;
    of.close();


    ifstream read("d:/tester.txt");
    read >> x;
    cout << x << endl ;
}
#include <i



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: