Looping arrays
#1

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?
Reply


Messages In This Thread
Looping arrays - by Misiur - 01.02.2013, 14:50
Re: Looping arrays - by Misiur - 01.02.2013, 15:27

Forum Jump:


Users browsing this thread: 1 Guest(s)