You can't. Because the variable argument functions like your success()
has no knowledge of what type of arguments it receives, not even how many arguments.
The best you can do is to use certain format specifier in the format
parameter to provide information such as how many variable arguments and/or what type they are. And hope when this function is called, the caller would follow this law. This is what the printf()
family functions do.
Reference: How can I discover how many arguments a function was actually called with?