Read class objects from file c++
问题 I need to read class objects from file, but I don't know how. Here I have a class "People" class People{ public: string name; string surname; int years; private: People(string a, string b, int c): name(a),surname(b),years(c){} }; Now I would like to read peoples from .txt file and store them to objects of a class People. For instance, this is how my .txt file looks like: John Snow 32 Arya Stark 19 Hodor Hodor 55 Ned Stark 00 I think the best way to do this would be to create array of 4