Assuming I understand what you are asking about,..
For a variable called X,
X++ is post incremented,
++X is pre-incremented.
If these are the entire statements the end result is the same.
X is greater than it was by the value of 1.
However, it makes a difference if you do the increment in the same statement as an assignation.
Thus, (assuming X starts with a value of 1)
Y == X++;
... results in Y holding 1 .. Y is given the value of X, THEN X is incremented. (POST)
Y== ++X;
...results in Y holding 2 ... the increment is done first, then the value is given to Y (PRE)
Enter your message below
Sign in or Join us (it's free).