daily pastebin goal
1%
SHARE
TWEET

Untitled

a guest Mar 18th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Person {
  2. public:
  3.     string name;
  4.     string surname;
  5.     int age;
  6. };
  7.  
  8. int main()
  9. {
  10.     cout << "Enter name of the input file" << endl;
  11.     ifstream ifs;
  12.     string s, line;
  13.     cin >> s;
  14.     ifs.open(s);
  15.     while (!ifs.eof()) {
  16.         Person Rob;
  17.         getline(ifs, line);
  18.         sscanf(line,"%s %s %d", &Rob.name, &Rob.surname, &Rob.age);
  19.     }
  20.     ifs.close();
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top