Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef PERSON_H
- #define PERSON_H
- #include <string>
- #include <iostream>
- class Person {
- public:
- // type members
- using id = std::string;
- // constructors
- Person() = default;
- Person(std::string name, std::string address);
- // interface
- void setName(id fName);
- std::string getName() const;
- void setAddress(id fAddress);
- std::string getAddress() const;
- //friends
- friend std::istream& read(std::istream& is, Person& fPerson);
- friend std::ostream& print(std::ostream& os, const Person& fPerson);
- private:
- id name = "not set";
- id address = "not set";
- };
- // auxilary funcs
- std::istream& read(std::istream& is, Person& fPerson);
- std::ostream& print(std::ostream& os, const Person& fPerson);
- #endif
Add Comment
Please, Sign In to add comment