Passing Variable Numbers of Arguments

Mark W. Schumann catfood at NCoast.ORG
Sun Feb 17 11:35:04 AEST 1991


In article <5196 at media-lab.MEDIA.MIT.EDU> dyoung at media-lab.media.mit.edu.UUCP (David Young) writes:
>I'd like to be able to write a macro or a function that will take an
>unspecified number of arguments -- similar to how the printf() function
>works.  What I'd like is something that could transform a call like:
>
>     PringMsg( window, formatString, <formatArgs>)
>
>into the following chunk of code:
>
>     { 
>       sprintf( globalFoo, formatString, <formatArgs>);
>       BlahBlah( window, globalFoo);
>     }
>
>I was hoping to find something similar to the &rest capability of Lisp.
>But am scared I'll have to end up using vprintf().
>
>Can anyone help or offer a suggestion or solution?

vsprintf() is part of ANSI C according to my Turbo manual.
^^^^^^^^


-- 
============================================================
Mark W. Schumann  3111 Mapledale Avenue, Cleveland 44109 USA
Domain: catfood at ncoast.org
UUCP:   ...!mailrus!usenet.ins.cwru.edu!ncoast!catfood



More information about the Comp.lang.c mailing list