arguments and parameters difference

• February 1st, 2009, 01:39 AM
E-man96
arguments and parameters difference
I already know what the difference is but does anyone know a good way to memorize the difference between the two?
• February 1st, 2009, 03:05 AM
potatoCode
Re: arguments and parameters difference
Hello E-man96,
That sounds like fun.
Hm, how about you look at the parameters as the Happy Meal and the arguments as what's in the bag? If there's no burger, fries, drink and pokemon action figure, then you know you didn't get the right meal.
• February 1st, 2009, 05:45 AM
laserlight
Re: arguments and parameters difference
Using the definitions from Stroustrup's C++ glossary:
argument - a value passed to a function or a template. In the case of templates, an argument is often a type.
parameter - a variable declared in a function or templates for representing an argument. Also called a formal argument. Similarly, for templates.

Sometimes "argument" is used in both cases, upon which "actual argument" means argument and "formal argument" means parameter. Likewise, sometimes "parameter" is used in both cases, upon which "actual parameter" means argument and "formal parameter" means parameter.

EDIT:
Okay, I did not read the question very carefully... but I personally find it easy to distinguish between the two after some practice. Often it does not matter anyway as the terms might be used interchangeably.
• February 1st, 2009, 06:37 AM
Peter_APIIT
Re: arguments and parameters difference
Although the term was used interchangeably but i think it is better to differentiate it.

Code:

``` void display(vector<int>&) --- Paramater vector<int> vec; display(vec);  --- Argument```
• February 1st, 2009, 06:45 AM
Joeman
Re: arguments and parameters difference
A simple way to remember is to look at the what the function(or anything else like a template, class..) requires and this is the "parameters" and what I will pass is the "arguments".