What does {-1,...} mean? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: What does {-1,...} mean? (
/showthread.php?tid=546524)
What does {-1,...} mean? -
yellow - 15.11.2014
Hey
I've looked through some threads and noticed that a lot of people use
Код:
new Var[MAX_PLAYERS] = {-1,...};
or sth. like this.
Why dont they use
Код:
new Var[MAX_PLAYERS] = -1;
?
Is the reason that only one element of the array gets the value -1?
-Greetz
Re: What does {-1,...} mean? -
Djole1337 - 15.11.2014
using "-1" sets only the first element to -1 however "-1, ..." sets all elements to -1.
AW: What does {-1,...} mean? -
yellow - 15.11.2014
Alright. Thanks