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

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -