fork(5) download
  1. #include <iostream>
  2. #include <sstream>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. std::string input = "0|X|X|1|x|2|3|X";
  8. std::istringstream ss(input);
  9. std::string token;
  10.  
  11. while(std::getline(ss, token, '|')) {
  12. std::cout << token << '\n';
  13. }
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
0
X
X
1
x
2
3
X