Dynamic Function Parameters

Go4Expert Member
27Aug2008,00:33   #1
kanaks_go4ex's Avatar
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' ?

thanks
Ambitious contributor
27Aug2008,01:44   #2
oogabooga's Avatar
Look up "variable length argument lists".

"printf" uses a variable number of arguments.
Code:
printf("hi");
printf("%d %d", 1, 2);
The prototype for printf is
Code:
int printf(const char *format, ...);
Go4Expert Founder
27Aug2008,09:23   #3
shabbir's Avatar
Look at OutputDebugString with variable number of arguments where I have applied a wrapper for a function to give a variable number of arguments