Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include<string>
- #include<iostream>
- using namespace std;
- class Human {
- protected:
- string name;
- string surname;
- int data;
- public:
- Human(): name(), surname(), data(0){}
- Human(string na, string su,int d): name(na),surname(su),data(d){}
- Human(const Human& h): name(h.name), surname(h.surname), data(h.data){}
- virtual ~Human() {}
- friend ostream& operator<<(ostream& out, const Human& h){
- out<<"Name:"<<h.name<<"\t"<<"Surname:"<<h.surname<<"\t"<<"Data:"<<h.data<<endl;
- return out;
- }
- friend istream& operator>>(istream& in, Human& h) {
- in >> h.name;
- in >> h.surname;
- in >> h.data;
- return in;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement