Horizontal Nav

Saturday, 15 June 2013

Difference Between Parameter and Argument

Parameter
Parameter is a variable in the declaration of function.
int add(int x,int y)
{
return x+y;
}
In this example int x,int y are parameters.
Argument
Argument is the actual value of this variable that gets passed to function.
E.g.
int result;
result=add(1,2);

In this example 1,2 are arguments.

No comments:

Post a Comment