C Formal Vs Actual Parameters
What is Parameter ?
- In C Programming Function Passing Parameter is Optional.
- We can Call Function Without Passing Parameter .
Function With Parameter :
add(a,b);
- Here Function add() is Called and 2 Parameters are Passed to Function.
- a,b are two Parameters.
Function Call Without Passing Parameter :
Display();What is Actual Definition of Parameter ?
In computer programming, a parameter is a special kind of variable, used in a subroutine to refer to one of the pieces of data provided as input to the subroutine.These pieces of data are called arguments. [Definition From Wiki]Note :
- Parameter Means Values Supplied to Function so that Function can Utilize These Values.
- Parameters are Simply Variables.
- Difference between Normal Variable and Parameter is that “These Arguments are Defined at the time of Calling Function“.
- Syntactically We can pass any number of parameter to function.
- Parameters are Specified Within Pair of Parenthesis .
- These Parameters are Separated by Comma (,)
Display(a,b,c,d,e);
- Parameter : The names given in the function definition are called Parameters.
- Argument : The values supplied in the function call are called Arguments.
Formal Parameter : |
void main()
|
Actual Parameter : |
void main()
|