Is there a difference between a "parameter" and an "argument", or are they simply synonyms?
4 Answers
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
and y
would be formal parameters:
int foo(int x, int y) {
...
}
Whereas here, in the function call, 5 and z
are the actual arguments:
foo(5, z);

- 14,121
- 5
- 58
- 82
-
5Speaking of terminology, what is the "&c" you used? Does that mean "and vice versa" or something like that? – Jake Petroules Jul 22 '10 at 05:15
-
40"&" is a ligature of "e" and "t", so it means "et", which is latin for "and". The "c" stands for "cetera", which means "(the) other(s)" (Nom. pl. n.). So you can substitute it with something like "and (the) other things", or "and so on". – danlei Jul 22 '10 at 11:26
-
11@JakePetroules in other words it is short for "et cetera" http://en.wikipedia.org/wiki/Etcetera but I would say (anecdotally) it is more commonly abbreviated etc. – Caltor Oct 03 '13 at 10:17
-
42I'd like to see the &ymology of that usage. – JoeCool Jan 29 '14 at 15:16
-
If I want to avoid all ambiguity, I use "parameter values" instead of "arguments".. – donquixote Jul 09 '14 at 00:30
-
2@donquixote I would say that "parameter values" and "arguments" are not synonyms. For example you may make the following call foo(1, 2, 3) where (in C# for example) the signature of the called method is foo(a, params int[] b). Here the arguments are 1, 2, 3 and the parameter values are 1 and {2, 3}. – fractor Dec 24 '16 at 09:26
-
@JoeCool What does "ymology" mean? :-) – wizzwizz4 Nov 29 '17 at 18:41
-
1Using the `&c` as an abbreviation for `etc` an answer about _terminology_ is incredibly surprising, and it gets worse as you're using C-esque syntax in your example... i swear I've read "the pointer address of `c`" – MestreLion Sep 15 '18 at 11:45
-
@MestreLion Fixed. – danlei Sep 15 '18 at 13:05
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).
double sqrt(double x)
{
...
return x;
}
void other(void)
{
double two = sqrt(2.0);
}
Under my thesis, x is the parameter to sqrt()
and 2.0 is the argument.
The terms are often used at least somewhat interchangeably.

- 730,956
- 141
- 904
- 1,278
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.

- 957
- 1
- 9
- 21
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.

- 169,992
- 32
- 429
- 468