Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. string s; // reading in file strings
  2.   int j = 0;
  3.   if (!input.is_open()) {
  4.     cout << "did not open.";
  5.   }
  6.   else {
  7.     while (getline(input, s)) {
  8.       for (int i = 0; i < s.size(); ++i) {
  9.         i = s.find("{", i);
  10.         j = s.find("},", j + 1);
  11.         cout << s.substr(i, j - i + 1) << endl;
  12.         //myArray[i] = s.substr(i, j - i + 1);
  13.        
  14.        
  15.        
  16.        
  17.        
  18.         /*if (s.at(i) != ' ')
  19.           s2 += s.at(i);
  20.           cout << s2;
  21.           //myArray[i] = s2;*/
  22.          
  23.       } // end for
  24.      
  25.     } // end while
  26.     //cout << myArray[0] << endl;
  27.     //cout << myArray[1] << endl;
  28.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement