15.09.2012, 23:43
The ampersand means that the argument is to be passed as a reference, not as a value. If you pass arguments by value (the default) then the original value of the variable will not change. If you pass arguments by reference then they will. For example:
Will print 43. Whereas:
Will still print 42.
pawn Код:
new a = 42;
stock byRef(&value)
{
value++;
}
byRef(a);
printf("%d", a);
pawn Код:
new a = 42;
stock byVal(value)
{
value++;
}
byVal(a);
printf("%d", a);