如何用C++从.txt文件中读取数据写入数组

日期:2016-12-26 13:56:11 人气:3

如何用C++从.txt文件中读取数据写入数组

//三句代码搞定问题#include #include #include #include using namespace std;int main (int, char* []) { ifstream fin("data.txt"); istream_iterator begin(fin),end; vector vecInt(begin, end); for (auto itr = vecInt.cbegin(); itr != vecInt.cend(); ++
    A+
热门评论