Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. string filename = "file.dat";
  2. fstream infile(filename);
  3. string line;
  4. while (getline(infile, line)) {
  5. string item;
  6. stringstream ss(line);
  7. vector<string> splittedString;
  8. while (getline(ss, item, '|')) {
  9. splittedString.push_back(item);
  10. }
  11. int a = stoi(splittedString[0]);
  12. // I do some processing like this before some manipulation and calculations with the data
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement