What is the difference between argument and parameter? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the difference between argument and parameter?

17th Jan 2016, 7:03 PM
Khan
Khan - avatar
2 Answers
+ 5
Arguments the values you pass to the function when you are calling it. Parameters are local variables that are initialized with the values passed as arguments when a function is called. I.e.: parameters are values that a function need to do its job, and these parameters will have the values of the arguments you passed when you called the function.
3rd Feb 2016, 7:42 PM
Nelson Neto
Nelson Neto - avatar
+ 4
consider a function, int func(int x,int y) - in this kinda situation, x and y are parameters ! But within main function when you're actually calling the func then whatever may be the data you're going to enter act as arguments!
25th Jun 2016, 6:08 PM
Anurag Sharma
Anurag Sharma - avatar