>Consider two functions A and B, both of which accept a variable number
>of arguments (va_start, va-arg, va_end). Is there an easy way for
>arguments passed to A to be, in turn, passed to B? (For example, if A
>is a wrapper function around B).
The main (and probably ONLY) reason for the existence of functions
like vfprintf(), vsprintf(), etc. is that you CANNOT pass on a
variable argument list from one varargs function to another varargs
function. You can, however, pass a variable argument list to a
function taking a va_list (like vprintf(), vsprintf(), etc.).
Typically, the function taking the variable argument list is the
wrapper, and the one taking the va_list does the work.
Gordon L. Burditt
|