If you use a variadic function, you need some way to tell the function how many arguments were passed. For example, printf()
and friends take a formatting string that contains format specifiers for each of the passed arguments, and they count the number of format specifiers to determine how many arguments were passed.
When passing a list of pointers, you can accomplish this "more simply" by passing a null pointer as the last argument. That way, you simply read arguments until you reach the null pointer.
However, you should seriously consider not using a variadic function for this. You can accomplish the same behavior by taking a vector of pointers as a parameter and iterating over the contents of that vector. There are a number of reasons why this is superior to using a variadic function:
Variadic functions have absolutely no type safety. You lose any and all type information about the arguments when you pass them to a variadic function, so for example, a caller of your function could pass a numeric value instead of a pointer and you'd never be able to tell inside of your function.
With the variadic solution, the caller must correctly indicate the number of arguments. If the caller omits the null pointer at the end (or otherwise misinforms your function of how many arguments there are) and you try to read more arguments than were passed, you end up with undefined behavior. Right now you might say "well, that's not hard to forget," but inevitably, someone will forget or screw it up and debugging this sort of issue is a beating.
The solution taking a vector and iterating over its contents is far simpler to implement, easier to debug, and much more idiomatic in C++.
Wherever there is an option between using a variadic function and not using a variadic function, you should prefer not to use a variadic function (I'll admit, I have never written a variadic function in any of the C++ code I have written, though I've written a few in C).