Answer to Question #157627 in C++ for zain ul abdeen

Question #157627

What is the difference between function argument and parameter?


1
Expert's answer
2021-01-26T09:49:02-0500

Parameters of a function are the variables that appear in the function definition. The manes of these variables are used in the function body for doing its work.

Arguments are the values that are passed to the function when it is called. These values are used in real calculations.

For example in

int add(int a, int b) {
  return a+b;
}

int main() {
  int x=1, y=2, z=0;
  z = add(x, y);
  return 0;
}

a and b are parameters of the function add, while x and y are its arguments.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS