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
when does a list get sent to the screen on the presentation layer?
What are the different types of laws. What are they?
What is the use of the raising exception?
What is protect & endprotect?
What is the function module to popup contents in the internal table?
MY DOMAIN IS SAP-ABAP COMPARE TO WEBDYNPRO AND CRM-TECHNICAL WHICH IS BEST?
Does the call transaction method allow multiple transactions to be processed by sap?
How the transaction that are programmed by the user can be protected?
What is the difference between a structure and an append structure?
What are system variable in abap?
How we format the data before writing a statement in the report?
Explain what is a foreign key relationship? Explain this with the help of an example.
What is the difference of update types in call transaction method ? : abap bdc
How do you connect to the remote server if you are working from the office for the client in remote place?
how to modify the standard method as per your requirement