0
Is arguments and parameters same in a function in c ++? If they are, then how? And if they are not, then how?
Function
2 Antworten
+ 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!