Jump to content

C++ Language/ProgramFlow/Parameters/VariableNumberOfParameters

From Wikibooks, open books for an open world

A parameter's type could be std::initializer_list<int>. This allows for passing either as DoFunction({11,22,33}) or as DoFunction(11,22,33).

Additional information about having a variable number of parameters (includes interactive examples)