Building function call at runtime
Tom Stockfisch
tps at chem.ucsd.edu
Mon Dec 11 12:10:29 AEST 1989
In article <307 at gtenmc.UUCP> stumpf at gtenmc.UUCP (Jon S. Stumpf) writes:
> How do I get the variables off the application stack and
> onto the runtime stack so error() can use <varargs.h> ?
Use vfprintf(), which takes a varargs list as an argument:
static void
error(ap)
va_list ap;
{
FILE *fp;
char *format;
fp = va_arg( ap, FILE * );
format = va_arg( ap, char * );
vfprintf( fp, format, ap );
handleError();
}
--
|| Tom Stockfisch, UCSD Chemistry tps at chem.ucsd.edu
More information about the Comp.lang.c
mailing list