How to get the number of arguments passed to a function?
#1

I am trying to make a function .

In C++, we do like
Suppose
pawn Код:
float avg( int Count, ... )
{
      va_list Numbers;
      va_start(Numbers, Count);
      int Sum = 0;
      for(int i = 0; i < Count; ++i )
            Sum += va_arg(Numbers, int);
      va_end(Numbers);
      return (Sum/Count);
}
What I want is to remove int Count argument. I dont want user to calculate and tell code about the number of arguments.
Any way of doing it?

Also, How do I do it for PAWN.
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=77000
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)