- Modern C++:Efficient and Scalable Application Development
- Richard Grimes Marius Bancila
- 97字
- 2021-06-10 18:28:04
Function parameters
Functions may have no parameters, in which case the function is defined with a pair of empty parentheses. A function definition must give the type and name of the parameters between the parentheses. In many cases, functions will have a fixed number of parameters, but you can write functions with a variable number of parameters. You can also define functions with default values for some of the parameters, in effect, providing a function that overloads itself on the number of parameters passed to the function. Variable argument lists and default arguments will be covered later.