开发者

What is this at the end of function ,...) in c++ [duplicate]

This question already has answers here开发者_C百科: Closed 12 years ago.

Possible Duplicate:

In a C function declaration, what does “…” as the last parameter do?

What does this mean ,...); it is written at the end of a function in a code i am debuging.

like this void abc( int a, int b, ...);


It means the function can take any number of extra arguments. For example, consider printf; the first argument is the format string, and then there can be any number of arguments after that for all of the modifiers. This would be represented by using ... after the first argument when defining the function.


That specifies a variable number of arguments which can be accessed using the macros in the cstdarg header.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜