Difference Between Call By Value and Call By Reference?
Answer Posted / shrikant patil
Call by value method:
passing the value of variable to the function.
void main()
{
int x=10,y=20;
printf("%d%d',x,y);
swap(x,y);
}
void swap(int a,int b)
{
int c;
c=a;//changes here do not affect in values
a=b;//of x and y in main function..
b=c;
}
call by reference method:
passing the address of variable to the function.
swap(&a,&b)
&c=&a;
&a=&b;
&b=&c;
changes made in subfunction causes changes in address of
variables n thus in main () also..
Is This Answer Correct ? | 155 Yes | 33 No |
Post New Answer View All Answers
What is an update task? : abap modularization
What is the use of abap data dictionary? : abap data dictionary
Difference between stand alone CRM and back-end CRM
Explain what is sap script?
What are the differences between macro and subroutine?
What is locking? : abap data dictionary
Final class
dear friends, do you know how to configure web dynpro and adobe into ECC6.0 IDES?
Explain what are the system fields? Explain?
How do you write a function module in sap?
what is call back in alv?
How can cluster table be created?
Have you set up a back ground job ? How to create a background job without a variant ?
What are the different types of views and their definition?
Which objects are independent transport objects? : abap data dictionary