Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <string>
- #include <stdlib.h>
- // #define _WIN32_WINNT 0x0500 // windows >= 2000
- #include <windows.h>
- #include <conio.h>
- #include <vector>
- #include <iostream>
- #include <iostream>
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- class Address {
- public:
- string addressLine, city, state;
- Address(string addressLine, string city, string state)
- {
- this->addressLine = addressLine;
- this->city = city;
- this->state = state;
- }
- };
- class Employee
- {
- private:
- Address* address;
- public:
- int id;
- string name;
- Employee(int id, string name, Address* address)
- {
- this->id = id;
- this->name = name;
- this->address = address;
- }
- void display()
- {
- cout << id << " " << name << " " <<
- address->addressLine << " " << address->city << " " << address->state << endl;
- }
- };
- int main(void) {
- Address a1 = Address("evefew, ffqfca", "fefa", "ffca");
- Employee e1 = Employee(101, "vsvs", &a1);
- e1.display();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement