Friday, September 23, 2011

Parameters Vs Arguments

The parameter refers to any statement in the parentheses following the function
name in a function declaration or definition, the argument is any expression
inside the parentheses of a function call.


Defination 1.parameter procedure used in
      2.arguments used in the procedure call


This example demonstrates the difference between a parameter and an argument:

void foo (int a, char b) / / b are parameters,
here the procedure is to define

int main ()
{
foo (5, 'a') / / 5 and 'a' are the arguments,
Here the procedure is called
return 0;
}

No comments :

Post a Comment