So I have an upDate object that has a pointer member variable that just points to an array that defaults to May 11, 1959:
upDate::upDate()
{   dptr = new int[3];
    dptr[0] = 5;
    dptr[1] = 11;
    dptr[2] = 1959;
}
Now in my main I'm supposed to override the + operator.
upDate D1(5,9,1994);
upDate D2 = D1+1;//supposed to add 1 more day to the upDate.
But when I output D2, it doesn't have me 5/10/1994. It gives me a really large negative number: -572662307/-572662307/-572662307.
Here's my operator+ method:
upDate upDate::operator+(int integer){
    upDate temp;
    int m = dptr[0];
    //cout << m << endl;
    int d = dptr[1];
    int y = dptr[2];
    int julian = convertToJulian(y, m, d);
    julian += integer;
    //cout << julian << endl;
    temp.convertToGregorian(julian);
    //cout << temp.getMonth() << " " << temp.getDay() << " " << temp.getYear() << endl;
    return temp;
}
All the couts in that method were just me testing to see if it's correct, and they are. So, I don't think any of these are incorrect. However, when I return the temp, I think something gets lost along the way of returning the temp as the D2. Maybe it's a pointer issue? I'm not really sure.
Edit: here's my operator=:
upDate upDate::operator=(upDate copy) {
for(int i = 0; i<3; i++)
    copy.dptr[i] = dptr[i];
return copy;
}
and my destructor:
upDate::~upDate()
{
    delete []dptr;
}
I guess I never made a copy constructor...But I'm confused on how to make it?
 
     
     
     
    