1 #include <fstream> 2 #include <vector> 3 #include <iterator> 4 #include <iostream> 5 using namespace std; 6 7 int main(void){ 8 ifstream in("data.txt"); 9 typedef istream_iterator<double> IsIter; 10 vector<double> vec; 11 copy( IsIter(in), IsIter(), back_inserter(vec) ); 12 copy( vec.begin(),vec.end(), ostream_iterator<double>(cout," ") ); 13 }