Brief description about actual parameters and formal parameters in c++
Answers
Answered by
1
Formal parameters are those values which are declared in the function defination..
Whereas actual parameters are those values which are passed to the method or function..
For example
void example(int a, int b) //here a and b are formal parameters..
{
cout<<a<<b;
}
void main()
{
int c, d;
cin>>c>>d;
example(c, d) //here c and d are actual parameters
}
Hope this helps..
Whereas actual parameters are those values which are passed to the method or function..
For example
void example(int a, int b) //here a and b are formal parameters..
{
cout<<a<<b;
}
void main()
{
int c, d;
cin>>c>>d;
example(c, d) //here c and d are actual parameters
}
Hope this helps..
Similar questions