Looping arrays - 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: Looping arrays (
/showthread.php?tid=412291)
Looping arrays -
Misiur - 01.02.2013
Minimalistic excerpt of my problem:
pawn Код:
#include <a_samp>
main() {
foo({ 1, 2, 3 });
}
stock foo(bar[]) {
for(new i = 0, j = sizeof bar; i < j; ++i) printf("Currently at %d", i);
}
Compilation:
Quote:
line with loop: warning 224: indeterminate array size in "sizeof" expression (symbol "")
|
I understand that in compile time the size of array is not known. Is there way to solve this without adding parameter with array size?
Re: Looping arrays -
Misiur - 01.02.2013
As always, great answer (I cannot give you more rep though :c)