Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: problems with varargs Message-ID: <7163@brl-smoke.ARPA> Date: 22 Jan 88 20:49:02 GMT References: <7962@eleazar.Dartmouth.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 29 Keywords: varargs #include /* for `stdout' */ #include void myprintf( va_alist ) /* NOTE: do not declare any "fixed" args here */ va_dcl { void myfprintf(); char *fmt; va_list ap; va_start( ap ); fmt = va_arg( ap, char * ); /* pick up "fixed" arg like this */ /* access the first few arguments via va_arg, as needed */ myfprintf( stdout, fmt, ap ); va_end( ap ); } void myfprintf( f, fmt, ap ) FILE *f; char *fmt; va_list ap; /* NOTE: type must agree with caller! */ { /* access the remaining arguments via va_arg, as needed */ }