This question already has an answer here:
Is there a difference between a "parameter" and an "argument", or are they simply synonyms?
This question already has an answer here:
Is there a difference between a "parameter" and an "argument", or are they simply synonyms?
Arguments and parameters are different in that parameters are used to different values in the program and The arguments are passed the same value in the program so they are used in c++. But no difference in c. It is the same for arguments and parameters in c.
They are often used interchangeably in text, but in most standards the distinction is that an argument is an expression passed to a function, where a parameter is a reference declared in a function declaration.
Argument is often used in the sense of actual argument vs. formal parameter.
The formal parameter is what is given in the function declaration/definition/prototype, while the actual argument is what is passed when calling the function — an instance of a formal parameter, if you will.
That being said, they are often used interchangeably, their exact use depending on different programming languages and their communities. For example, I have also heard actual parameter etc.
So here,
x
andy
would be formal parameters:Whereas here, in the function call, 5 and
z
are the actual arguments:Generally, the parameters are what are used inside the function and the arguments are the values passed when the function is called. (Unless you take the opposite view — Wikipedia mentions alternative conventions when discussing parameters and arguments).
Under my thesis, x is the parameter to
sqrt()
and 2.0 is the argument.The terms are often used at least somewhat interchangeably.