0

Is there any difference between a function's parameters and its argument in c++? Or they both are same?

16th Jun 2017, 7:00 AM
Vaibhav Goswami
Vaibhav Goswami - avatar
3 Antworten
+ 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.
16th Jun 2017, 7:08 AM
Michael Simnitt
Michael Simnitt - avatar
+ 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
16th Jun 2017, 11:43 AM
Jakub Stasiak
Jakub Stasiak - avatar
+ 1
confusion cleared tysm Jakub
16th Jun 2017, 3:17 PM
Vaibhav Goswami
Vaibhav Goswami - avatar