TODAY JAVA SCHOOL

In java school, programming, design, computer general knowledge, web application, software, web services, social media, digital marketing, oops, concept of programming language, oops feature, console media, graphics medium, first programming, c, c ++ , Java, PHP, SQL, MySQL, HTML, HTML_5, J_query, JavaScript, Bootstrap, Framework, images with logos, examples, shared and explained.

https://www.amazon.in/b?node=26373545031&linkCode=ll2&tag=1234567801cdb-21&linkId=3b9882431b00409b44141e0344b35a15&language=en_IN&ref_=as_li_ss_tl

Breaking

Monday 13 July 2020

Actual And Formal Arguments In C++| Actual And Formal Arguments In C++ Example| Actual And Formal Arguments In C++ Syntax| Actual And Formal Arguments In C++ In Hindi

Actual And Formal Arguments In C++


Actual And Formal Arguments

The arguments may be classified under two groups, actual and formal arguments.

 

download image of actual and formal argument in c++

Fig: Actual and Formal Arguments in c++

(a)          Actual arguments  

An actual argument is a variable or an expression contained in a function call that replaces the formal parameter which is a part of the function declaration.

      Sometimes, a function may be called by a portion of a program with some parameters and these parameters are known as the actual arguments.

 

For example

  #include <iostream.h>

           void main ()

           {

                 int x,y;

                 void output (int x, int y) ; / / function declaration 

output (x,y) ; / / x and y are the actual arguments

           }

 

(b)          Formal arguments  

Formal arguments are the parameters presents in a function definition which may also be called as dummy arguments or the parametric variables. When the function is invoked, the formal parameters are replaced by the actual parameters.

 

     For example

          #include <iostream.h>

         void main ()

           {

                 int x,y;

                 void output (int x, int y) ;

                output (x,y) ;

           }

           void output (int a, int b)  / / formal or dummy arguments

           {

                   / /body of the function

           }

 


No comments:

Post a Comment