Hi guys! (No, I'm not positing homework, I'm just confused with a concept.
I wanna be able to overload a -- function.
I had ++ example that looked like this...
money::money::operator ++(int blah)
{
int tmp_d = dollars;
int tmp_c = cents;
dollars ++;
return money(tmp_d, tmp_c);
So for my -- operator I did this.
money::money::operator --(int blah2)
{
int get_dollars() = dollars;
int get_cents() = cents;
dollars ++;
return money(get_dollars(), get_cents());
I was told the
return money(get_dollars(), get_cents()); can be left there and you can program the rest, yet I just wanna check if I'm actually coding this right.