0

What is the difference between a parameter and an argument in a function?

19th Mar 2017, 4:00 PM
Mthoko
Mthoko - avatar
1 Odpowiedź
+ 3
Parameter is the variable declared in the function's prototype. int sum (int a, int b){ //here a and b are parameters } Argument is the value passed while function call, which can be literal or variable. cout << sum (23, 45); //here 23 and 45 are arguments
19th Mar 2017, 4:33 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar