#include <iostream>
#include <cstring>

using namespace std;
class Employee
{
public:
    Employee(char *name, int id);
    ~Employee();
    char *getName()
    {
        return _name;
    }
//Other Accessor methods

    int _id;
    char *_name;
};

Employee::Employee(char *name, int id)
{
    _id = id;
    _name = new char[strlen(name) + 1];
//Allocates an character array object
    strcpy(_name, name);
}

Employee::~Employee()
{
    delete[] _name;
}

int main()
{
    Employee programmer("John",22);
    cout << programmer.getName() << endl;
    cout << "address of programmer       = " << (void*)&programmer << endl;
    cout << "address of programmer._id   = " << (void*)&programmer._id << endl;
    cout << "address of programmer._name = " << (void*)&programmer._name << endl;
    cout << "programmer._name point to   = " << (void*)programmer._name << endl;

    Employee manager = programmer;
    cout << manager.getName() << endl;
    cout << "address of manager       = " << (void*)&manager << endl;
    cout << "address of manager._id   = " << (void*)&manager._id << endl;
    cout << "address of manager._name = " << (void*)&manager._name << endl;
    cout << "manager._name point to   = " << (void*)manager._name << endl;
    return 0;
}
