0

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

19th Mar 2017, 4:00 PM
Mthoko
Mthoko - avatar
1 Answer
+ 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