i-- and --i do essentially the same thing: They subtract 1 from i. The difference is that i-- will subtract 1 after an action is completed, while --i will subtract one before the action. This makes more sense in the case of a for loop:
for (i = 5; i > 0; i--) {...}
In this case, the for loop will run with i equaling 5, then at the end of the loop, it will repeat, but subtract 1.
If the case was this:
for (i = 5; i > 0; --i) {...}
i would have 1 subtracted from it BEFORE the loop runs, so it would start off immediately with 0, but on the other hand, it would also run at the end when i = 0.
Saying --size
is like saying the value of size
minus 1.