What is the difference between i++ and ++i?

i++ returns the result of i after it has been incrsmented, whereas +i return the value of i before it has been incremented.

For Example:
                    if i were zero, then for
                    i = i+i
                    j = 1 and i =1, however if i were and you execute.
                    j = ++ i
                    then j = 0  and i = 1.

1 comment: