Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!emory!gatech!purdue!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: varargs Keywords: varargs Message-ID: <15121@smoke.brl.mil> Date: 7 Feb 91 19:19:50 GMT References: <1428@tau.sm.luth.se> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 28 In article <1428@tau.sm.luth.se> d90-pan@sm.luth.se (Per Andersson) writes: >I have a big problem using the varargs library. True. >What I want to do is to write a function that takes a variable number of >arguments and simply passes them on to another function like this: > a_func( va_alist ) > va_dcl > { > b_func( va_alist ); > }; a_func( va_alist ) va_dcl { va_list ap; va_start( ap ); b_func( ap ); va_end( ap ); } b_func( ap ) va_list ap; { char *fmt = va_arg( ap, char * ); ... }