C++ Function Parameters
Get acquainted with actual parameters, formal parameters, and the default values of the parameters.
Function parameters #
We can declare the variables inside the function definition as parameters. We specify the list of parameters separated by a comma inside the round brackets. In C++, we have:
- Formal parameters
- Actual parameters
Formal parameters #
Formal parameters are the variables defined in the function definition. These variables receive values from the calling function. Formal parameters are commonly known as parameters.
Actual parameters #
Actual parameters are the variables or values passed to the function when it is called. These variables supply value to the called function. Actual parameters are commonly known as arguments.