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 the transaction code to display the payroll results ? : abap hr
What is the function module to popup contents in the internal table?
Can you print decimals in type n? What is difference between float and packed data type?
What is the full form of spro? : sap abap hr
please any one can tell me How to validate the data in Table maintinance generator?how can u validate the table field values if u r entering the data into fields .it shows record is wrong?wher we can done validation in table maitenance generator before getting the data as out ?
In tm, if a group of employees gets 10 days of annual leave, what will be the time evaluation status? : sap abap hr
What are the organizational related Infotypes
What do you understand by work area and internal tables in abap? Why do we use it?
Hat are the different types of mode (run code) in call transaction method?
What is evaluation path, where do we do it and why? : sap abap hr
What is lock object ? : abap data dictionary
Does sap handle multiple currencies?
What is the use of enqueue function module? : sap abap data dictionary
What is the functionality of BIZTALK and how it handles the IDOC’s and how u will transfer the IDOCS to the BIZTALK ?
Explain the difference between function group and function module?