Actual Argument and Formal Argument in C++

by Monika Dadool 17-Sep-18

0 531

Actual parameters are present in function calls whereas formal parameters are present in the function header of the definition. Formal parameters are known as the local or the parametric variables i.e. int y in the below example, that assigns values from the actual arguments when the function is called. Thus its value is replaced by the actual parameters

By default, the value of the Arguments is copied to the formal parameter during the calling time and the type of argument passing is pass-by-value.


As we all known earlier in the previous topic about the function declarations

i.e. void visual(int);

where int is known as the type of parameter and its name is optional. But when we are defining the same function as in the example

void visual(int y)
// code
Here, int y is known as a parameter. After this when we are calling the same function in main()
void visual(int y) // formal Argument
// code
int main()
{visual(200); // actual argument

During function call, the value specified or variable name is known as Argument whereas while defining function the variable is called parameter. The value of the argument supplied during function call is copied to the parameter. For example the value of visual(200) i.e. 200 is copied in the  y. Where y is the local variable whose scope is inside the visual() function.

Y can be used in the visual function. In many websites and book, the value of the function call is written an actual argument and the copied values in function definition are known as formal argument or parameter



    No Comments Yet.

Leave a Reply