What do your employee objects look like data-members-wise? Unless they are strictly POD you are going to have issues writting/reading to/from a file like you are attempting.
What do your employee objects look like data-members-wise? Unless they are strictly POD you are going to have issues writting/reading to/from a file like you are attempting.
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
Like this?
Code:class employee { public: employee(std::string, float); const std::string& get_name(); const float& get_payrate(); const std::string& get_gender(); const std::string& get_startdate(); const std::string& get_enddate(); void set_name(std::string); void set_payrate(float); void set_gender(std::string); void set_startdate(std::string); void set_enddate(std::string); private: std::string name; float payrate; std::string gender; std::string startdate; std::string enddate; bool active; };
Sometimes I forget what I am doing when I enter a room, actually, quite often.