| 
Call by value | 
Call by reference | 
| 
1.       The
  variable/value/expression is sent to the function is known as call by value. | 
1.       If
  the address is sent to the function it is known as call by reference | 
| 
2.       Syntax:
  function(variable,variable2); | 
3.       Syntax:function(&variable,&variable2); | 
| 
4.here formal parameters is
  variable 
Ex: intx | 
4.       Here
  formal parameters is pointers 
Ex:int*x | 
| 
5.       If
  the value is sent to the function ,that value cannot be modified | 
6.       Whenthe
  address is sent to the function the value is modified by using ‘*’operator | 
You may like the following posts:
Call by Reference
Function call
Functions
No comments:
Post a Comment