0
Is there any difference between a function's parameters and its argument in c++? Or they both are same?
3 Réponses
+ 6
The difference is a parameter is a type used to declare the type of information the method can receive (a set of rules if you like). Where the argument is the value being passed.
+ 1
Michael has put the words in some confusing way. I will try to explain it in my way:
int foo(int a, int b) // a and b are parameters
{
return a + b;
}
foo(5, 6); // 5 and 6 are arguments passed to function
Here it is explained aswell:
https://stackoverflow.com/questions/1788923/parameter-vs-argument
+ 1
confusion cleared
tysm Jakub