"P. Hari Krishna" <hk***********@NoSpamgmail.com> wrote in message
news:pa****************************@NoSpamgmail.co m...
Hi,
I have a situation where I do not know the number of arguments I pass to a
function at compile time.
So is there any way, that we can programmatically create a "va_list" and
then
pass it to the function that can the use to do some sprintfs ?
Unless I've completely misunderstood your question, surely it'd make sense
to just use one argument - a pointer to a NULL terminated array of (possibly
void) pointers? -- or two arguments if you're not sure at compiletime the
type of the data you're passing to your function. Or is the problem that you
need to pass an unknown number of arguments to a varargs function that has
been defined by someone other than you? -- if this is the case, I don't
believe it's possible in standard C, although it may be possible with some
machine-specific ASM.
~Kieran Simkin
Digital Crocus
http://digital-crocus.com/