Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <sstream>
- using namespace std;
- void fill(istream& is, vector<int>& ints)
- {
- int x;
- while (is >> x)
- {
- ints.push_back(x);
- }
- }
- int main()
- {
- vector<int> ints1, ints2;
- istringstream is1("1 2 3 4");
- fill(is1, ints1);
- istringstream is2("5 7");
- fill(is2, ints2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement