How to validate n++ against ++n? | Sololearn: Learn to code for FREE!

0

How to validate n++ against ++n?

My question is, how could I print or really know the value of variable "num" when ++ num? I mean, num++ is different to ++num, but, how could I validate it (++num increments and assign the value, but num++ is the opposite. Is there any way to validate it?)

c++

8/30/2016 4:08:57 PM

Rafael Figueroa

1 Answer

New Answer

0

What do you mean by 'validate'? As far as I know, ++num ans num++ are identical if you are just incrementing and not immediately taking the incremented value. If so, num++ is needed, if not then I believe ++num is kinda more effective (not that it matters).