+ 1
Question on C++ Practice 65.2
I have a question on the C++ practice on operator overloading. Question in code. Thank you :) https://code.sololearn.com/cq1QC37i0myi/?ref=app
2 Answers
+ 1
In the first case, you defined a default object k without a parameter, (argument), on the type of the Account() {} class, which means you cannot use
Account(int a): balance(a) {
interest += balance/10;
},
and therefore you need to make these calculations yourself.
+ 2
by first approach, you are not calculating interest value.
But 2nd calculating by constructor...