va_list + function pointers
- From: Lurkos <lurkos.usenet@xxxxxxxxx>
- Date: Thu, 28 Jun 2012 10:48:33 -0700 (PDT)
Hello.
I'm trying to figure out how can I make use of stdarg.h/va_list with
function pointers as variable arguments.
In particular I don't know which type I should put in va_arg call and
which name I should put in va_start call.
Do you know how to implement it in C?
Thanks!
e.g. (just tentative)
double myFunc(int k, double x, double (*fp1)(double,int), ...)
{
double result;
va_list vl;
va_start(vl, ????????);
do {
double (*fp_new)(double,int) = va_arg(vl, ???????);
// do stuff
} while ( (*fp_new) != NULL );
va_end(vl);
return result;
}
.
- Prev by Date: Re: A question for this group...
- Next by Date: va_list e function pointer
- Previous by thread: Learning C by reading
- Next by thread: va_list + function pointers
- Index(es):