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
#2

As always, great answer (I cannot give you more rep though :c)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)