Is arguments and parameters same in a function in c ++? If they are, then how? And if they are not, then how? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is arguments and parameters same in a function in c ++? If they are, then how? And if they are not, then how?

Function

25th Jul 2019, 3:11 AM
Merlyn J
1 Answer
+ 2
In a program there are two things a function is declared and function is called. When we write or declare a function which has parameters, these parameters are called formal parameters or parameters for simplicity. Now when function is called, as function takes parameter, we need to pass some vales or variables to this function. There values or variables passed to function while calling are called actual parameters or arguments. Example: int area (int length, int breadth) // here length and //breadth are formal parameters{ // body of function goes here } When function is called int a =10; int b = 20; int c = area(a, b); // call function // Here a, b are arguments or actual parameters. Now you can make out if parameters and arguments are same or different. Happy Learning!
25th Jul 2019, 5:25 AM
Popat
Popat - avatar