2009年12月29日 星期二

An ellipsis at the end of the parameter

An ellipsis at the end of the parameter specifications is used to specify that a function has a variable number of parameters. The number of parameters is equal to, or greater than, the number of parameter specifications.
int f(int, ...);
C++ The comma before the ellipsis is optional. In addition, a parameter declaration is not required before the ellipsis.
C At least one parameter declaration, as well as a comma before the ellipsis, are both required in C.

沒有留言: