Note the cast on the last argument. (Also note that the caller
must free the returned, malloc'ed storage.)

Under a pre-ANSI compiler, rewrite the function definition
without a prototype ("char*vstrcat(first) char *first;{"),
include <stdio.h> rather than <stdlib.h>, add "extern
char *malloc();", and use int instead of size_t. You may also
have to delete the (void) casts, and use the older varargs
package instead of stdarg. See the next question for hints.

This information is not available to a portable program. Some
old systems provided a nonstandard nargs() function, but its use
was always questionable, since it typically returned the number
of words passed, not the number of arguments. (Structures and
floating point values are usually passed as several words.)

Any function which takes a variable number of arguments must be
able to determine from the arguments themselves how many of them
there are. printf-like functions do this by looking for
formatting specifiers (%d and the like) in the format string
(which is why these functions fail badly if the format string
does not match the argument list). Another common technique
(useful when the arguments are all of the same type) is to use a
sentinel value (often 0, -1, or an appropriately-cast null
pointer) at the end of the list (see the execl and vstrcat
examples under questions 1.2 and 7.1 above).

The type-rewriting games which the va_arg macro typically plays
are stymied by overly-complicated types such as pointer-to-
function. If you use a typedef for the function pointer type,
however, all will be well.

In general, you cannot. You must provide a version of that
other function which accepts a va_list pointer, as does vfprintf
in the example above. If the arguments must be passed directly
as actual arguments (not indirectly through a va_list pointer)
to another function which is itself variadic (for which you do
not have the option of creating an alternate, va_list-accepting
version) no portable solution is possible. (The problem can be
solved by resorting to machine-specific assembly language.)