this is in my book and I can figure out what it wants me to do, but it sounds simple
the whole program isnt needed
in main there are objects a, b and c
int main()
{
a = b = c;
}
in the class Date we have
Date Date:perators=(const Date& newdate)
{
day = newdate.day;
month = newdate.month;
year = newdate.yar;
return *this
}
which makes the return vaue an R-value.
Im trying to figure out how to modify the assignment operator so the expression a = b = c returns an l-value.
any sugestions, hints , or explanations are appreciated.
thanks
the whole program isnt needed
in main there are objects a, b and c
int main()
{
a = b = c;
}
in the class Date we have
Date Date:perators=(const Date& newdate)
{
day = newdate.day;
month = newdate.month;
year = newdate.yar;
return *this
}
which makes the return vaue an R-value.
Im trying to figure out how to modify the assignment operator so the expression a = b = c returns an l-value.
any sugestions, hints , or explanations are appreciated.
thanks