+ 1
Help, overloading the c++ increment operator
How to overload the increment operator in this code!? https://code.sololearn.com/cfm14Hxa1HDt/?ref=app
1 Antwort
+ 3
- You have overloaded pre-increment operator (++x) and calling post increment operator.
- "c1" is a pointer pointing to the object, so calling (c1++) would increment the pointer instead of incrementing the object. ( Try ++(*c1) instead )
Here is the fix👇
https://code.sololearn.com/cWRfy5L5Ohih/?ref=app