c++ - Reuse istream_iterator variable -
i using 2 iterators read text file vector
:
std::ifstream input_file("~/blahblah.txt"); std::istream_iterator<float> start(input_file),end; std::vector<float> testframefloat(start,end); input_file.close();input_file.clear();
and then, use same ifstream
read text file. possible reuse same istream_iterators
instead of creating new ones? getting compilation errors if try so:
input_file.open("~/anothertext.txt"); start(input_file); //this compilation error std::vector<float> readvalues(start,end);
Comments
Post a Comment