C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

va_list + function pointers

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C Language
View previous topic :: View next topic  
Author Message
Lurkos
Guest





PostPosted: Thu Jun 28, 2012 5:48 pm    Post subject: va_list + function pointers Reply with quote



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;
}
Back to top
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C Language All times are GMT
Page 1 of 1

 
 


Powered by phpBB © 2001, 2006 phpBB Group