Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucsd!chem.ucsd.edu!tps From: tps@chem.ucsd.edu (Tom Stockfisch) Newsgroups: comp.lang.c Subject: Re: Building function call at runtime Keywords: function variable parameter stack Message-ID: <622@chem.ucsd.EDU> Date: 11 Dec 89 01:10:29 GMT References: <307@gtenmc.UUCP> Reply-To: tps@chem.ucsd.edu (Tom Stockfisch) Organization: Chemistry Dept, UC San Diego Lines: 21 In article <307@gtenmc.UUCP> stumpf@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 ? 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@chem.ucsd.edu