AddNums(...) <- Explain elipsis operator please
#1

I'd like to know the most efficient method of receiving the arguments of an unknown amount of args, example:

pawn Код:
Add(3, 40, 302);
Add(4,4,4,4,4,4,4);
I know you use getarg(); and numargs(); I can;t remember how to do it, lol.
Reply
#2

pawn Код:
for(new i, j = numargs(); i < j; i++)
{
    sum += getarg(i);
}
return sum;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)