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:

    Let us stun and astonish the intruding rabble of men and books and institutions by a simple declaration of the divine fact. Bid the invaders take the shoes from off their feet, for God is here within.
    Ralph Waldo Emerson (1803–1882)