Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. ifstream file;
  2. file.open('data.txt');
  3. string n = '';
  4. int g = 0;
  5. while(!file.eof())
  6. {
  7. file >> n >> g; // read string and number at same time
  8.  
  9. // do something with them
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement