C++ Functions Parameters
Functions Parameters
A function receives information that is passed to them as a parameter. Parameters act as variables inside the function.
Parameters are specified collectively inside the parentheses after the function name. parameters inside the parentheses are comma separated.
We have different names for different parameters.
Formal Parameters
So, the variable which is declared in the function is called a formal parameter or simply, a parameter. For example, variables a and b are formal parameters.
Actual Parameters
The values which are passed to the function are called actual parameters or simply, arguments. For example, the values num1 and num2 are arguments.
A function doesn't need to have parameters or it should necessarily return some value.