Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Dynamic Function Parameters (http://www.go4expert.com/forums/dynamic-function-parameters-t13303/)

kanaks_go4ex 27Aug2008 00:33

Dynamic Function Parameters
Hi all,

I'm little confused.

Is it possible to choose number of arguments 'n' for the function "F" in run time?
Function 'F' ('n ')

If possible,how do we declare the prototype for this Function 'F' ?


oogabooga 27Aug2008 01:44

Re: Dynamic Function Parameters
Look up "variable length argument lists".

"printf" uses a variable number of arguments.

printf("%d %d", 1, 2);

The prototype for printf is

int printf(const char *format, ...);

shabbir 27Aug2008 09:23

Re: Dynamic Function Parameters
Look at OutputDebugString with variable number of arguments where I have applied a wrapper for a function to give a variable number of arguments

All times are GMT +5.5. The time now is 20:51.