fork(1) download
  1. #include <iostream>
  2. #include <iterator>
  3. #include <sstream>
  4. #include <string>
  5. #include <vector>
  6.  
  7. using namespace std;
  8.  
  9. int main() {
  10. istringstream iss("2.3 4.3 5.6 2.1 4.4 3.1");
  11. std::istream_iterator<double> eos; // end-of-stream iterator
  12. std::istream_iterator<double> iit(iss);
  13. vector<double> res(iit, eos);
  14. cout << res.size() << endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
6