istringstream delimiter

Solutions on MaxInterview for istringstream delimiter by the best coders in the world

showing results for - "istringstream delimiter"
Camilla
20 Nov 2019
1// istringstream constructors.
2#include <iostream>     // std::cout
3#include <sstream>      // std::istringstream
4#include <string>       // std::string
5
6int main () {
7
8  std::string stringvalues = "125 320 512 750 333";
9  std::istringstream iss (stringvalues);
10
11  for (int n=0; n<5; n++)
12  {
13    int val;
14    iss >> val;
15    std::cout << val*2 << '\n';
16  }
17
18  return 0;
19}