When using va_start(), va_arg() and va_end() to read parameters passed to a method, is there a way to count how many arguments there are?
According to the man page if you call va_arg() too many times you get "random errors":
See Question&Answers more detail:osIf there is no next argument, or if type is not compatible with the type of the actual next argument (as promoted according to the default argument promotions), random errors will occur.