Functional Parameters
-
I've seen functions defined as:
int SetIniString(int nConfigSet, char \*Section, char \*Key, const char \*format, ... );
Could someone explain what the '...' in the parameter list means and does?
-
I've seen functions defined as:
int SetIniString(int nConfigSet, char \*Section, char \*Key, const char \*format, ... );
Could someone explain what the '...' in the parameter list means and does?
-
I've seen functions defined as:
int SetIniString(int nConfigSet, char \*Section, char \*Key, const char \*format, ... );
Could someone explain what the '...' in the parameter list means and does?
Paul Belikian wrote:
Could someone explain what the '...' in the parameter list means and does?
It means that the function also accepts zero or more parameters following the last named parameter. The function will then use some information passed by the caller (in this case the %x specifications in the format string) and the va_arg[^] functions, to access the extra parameters.
-
Hi Paul, That allows the function to accept a dynamic argument list. va_arg, va_end, va_start[^] Best Wishes, -David Delaune
Thank you David, for the explanation and link!
-
Paul Belikian wrote:
Could someone explain what the '...' in the parameter list means and does?
It means that the function also accepts zero or more parameters following the last named parameter. The function will then use some information passed by the caller (in this case the %x specifications in the format string) and the va_arg[^] functions, to access the extra parameters.
Thank you too Richard, I appreciate your response!