Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Person {
- public:
- string name;
- string surname;
- int age;
- };
- int main()
- {
- cout << "Enter name of the input file" << endl;
- ifstream ifs;
- string s, line;
- cin >> s;
- ifs.open(s);
- while (!ifs.eof()) {
- Person Rob;
- getline(ifs, line);
- sscanf(line,"%s %s %d", &Rob.name, &Rob.surname, &Rob.age);
- }
- ifs.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement