13.12.2012, 00:04
Quote:
|
Are you doing ++i just for user preference, or is it actually faster to do that instead of i++ ?
|
but the differences in code however are as follows.
pawn Код:
main()
{
new
a = 10,
b = 10;
printf("A with pre-increment: %d", ++a);
printf("A after pre-increment: %d", a);
printf("B with post-increment: %d", b++);
printf("B after post-increment: %d", b);
}
Код:
[18:19:14] A with pre-increment: 11 [18:19:14] A after pre-increment: 11 [18:19:14] B with post-increment: 10 [18:19:14] B after post-increment: 11
x++ is basically like adding 1 to the variable after executing the line


