help with ++
i saw alot of times stuff like this... (Var is an example
Код:
`Var[playerid] ++;`
can someone plz explain what does it do?
it does this:
pawn Код:
`Var[playerid] = Var[playerid] + 1;`
a.k.a. adds 1 to the value.
Quote:
 Originally Posted by xDeadlyBoy it does this: pawn Код: `Var[playerid] = Var[playerid] + 1;` a.k.a. adds 1 to the value.
so can i just do Var[playerid] += 1;
??
or you can do Var[playerid]++;
it's all the same.
Quote:
 Originally Posted by xDeadlyBoy or you can do Var[playerid]++; it's all the same.
ok... thx!
Ther are more, should you care:

PHP код:
``` Var = Var + 1; // Variable + 1 (add) Var++; // Variable + 1 Var += 1; // Variable + 1 Var = Var - 1; // Variable - 1; (substract) Var--; // Variable - 1; Var -= 1; // Variable - 1; Var = Var * 1; // Variable * 1; (multiply) Var *= 1; // Variable * 1; Var = Var / 1; // Variable / 1; (divide) Var /= 1; // Variable / 1; Var = Var & 1; // Variable with bitwise "and" (concatenate 1 bit) Var &= 1; // with bitwise "and" Var = Var | 1; // Variable with bitwise "or" (concatenate 1 bit) Var |= 1; // with bitwise "or"  ```
Hope that helps.

Forum Jump:

Users browsing this thread: 1 Guest(s)