Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement