Studying for the final and can't remember the details behind the copy constructor. I know what it does, just don't know the "why" behind some stuff.
Here is an example of a copy constructor I have.
Person::Person(const Person& aPerson) //m_variable=private variables
{
m_name = aPerson.get_name();
m_pBirthDate = new Date;
m_pBirthDate->set_year(aPerson.get_birthYear());
m_pBirthDate->set_month(aPerson.get_birthMonth());
m_pBirthDate->set_day(aPerson.get_birthDay());
}
Why is there an "m_pBirthDate =new Date"? I get everything else is copying over the info to the new variable... is it just pointing to a new date block to create the copy?