What Is The Difference Between The Prefix And Postfix Forms Of The ++ Operator
i=j++ this is postfix operator
Incase of postfix operation, current value of expression gets printed and then value gets incremented by 1. hence i=0 and j=1.
i=++j this is prefix operator
previous value of j is 1 and now j gets incremented by 1. hence i=2 and j=2
The postfix form returns the current value all of the expression and then performs the increment operation on that value.
2009-2016 downloadmela.com. All rights reserved.