calling a function without knowing the number of parameters in advance

Posted by Sourabh Bose on Stack Overflow See other posts from Stack Overflow or by Sourabh Bose
Published on 2012-03-26T03:10:58Z Indexed on 2012/03/26 5:28 UTC
Read the original article Hit count: 258

Filed under:
|
|

suppose i have a dll with 2 functions.name of dll="dll1" f1(int a, int b, int c);

f2(int a);

my program would take the funtion name ,the dll name and a "list" of parameters as input. how would i call the appropriate function with its appropriate parameters. i.e, if input is dll1 f1 list(5,8,9)

this would require me to call f1 with 3 parameters if input was dll1 f2 list(8) it would require me to call f2 with one parameter how would i call the function without knowing the number of parameters in advance.

further clarification: how do I write code that will call any function with all its arguments by building the argument list dynamically using some other source of information

© Stack Overflow or respective owner

Related posts about c++

Related posts about dynamic