Variadic Macro - Declaration Syntax

Declaration Syntax

The declaration syntax is similar to that of variadic functions: an ellipsis "..." is used to indicate that one or more arguments must be passed. Common compilers also permit passing zero arguments to such a macro, however. During macro expansion each occurrence of the special identifier __VA_ARGS__ in the macro replacement list is replaced by the passed arguments.

No means is provided to access individual arguments in the variable argument list, nor to find out how many were passed. However, macros can be written to count the number of arguments that have been passed.

Read more about this topic:  Variadic Macro

Famous quotes containing the word declaration:

    I enclose to you a copy of the declaration of independence as agreed to by the House, and also, as originally framed. You will judge whether it is the better or worse for the Critics.
    Thomas Jefferson (1743–1826)