what is the difference between i++ and++i code example
Example 1: the difference between i++ and ++i
i = 1;
j = ++i;
(i is 2, j is 2)
Example 2: the difference between i++ and ++i
i = 1;
j = i++;
(i is 2, j is 1)
i = 1;
j = ++i;
(i is 2, j is 2)
i = 1;
j = i++;
(i is 2, j is 1)