Ask your own question, for FREE!
Computer Science 11 Online
OpenStudy (aravindg):

when doing operator overloading for ++ operator and converting lowercase to upper or the other way depending on prefix or post fix use ,it seems one of them will have an argument (int ) while the other one doesnt .which will that be and why ?

OpenStudy (aravindg):

@Opcode take a look ?

OpenStudy (konradzuse):

What? :p

OpenStudy (anonymous):

in c++ if you overload ++ you distinguish the postfix version by giving it a dummy int parameter, which to my knowledge is pretty much only there so the compiler can tell the difference

OpenStudy (aravindg):

why is dummy int related to postfix and not prefix ?@mattvlaw

OpenStudy (anonymous):

I think it's just a rule to differentiate them for the compiler. I don't know of any logical reason why they made it that way and not the other way around, although I could be mistaken.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!