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
THANKS ALL. i CLEARED THE INTERVIEW OF INFOSYS BASED ON THIS QUESTION SET. IT REALLY WORKS. LONG LIVE ALLINTERVIEW.COM
How do you find out who has transported a transport request?
B -Credit Note report Selection Screen Ranges: Creation date Sales Org Sold to Party Selection condition: Document Category – VBTYP should be ‘O’ Table to be used: VBRK, VBRP,VBPA,ADRC List the CR order types or credit billing type by customer number (or selected customer) and displays the: - Billing Document date (FKDAT) - Customer number (KUNRG) - Name of the reseller (on top of the SAP No) (NAME1) - Billing document number,(VBELN) - order reason (AUGRU_AUFT) - Amount (NETWR) - Currency (WAERK) Group Currency wise, billing type wise sum of Net value. When user double click on field ‘Billing Document #’ , display the document in VF03 Do this using OO ABAP.
What are Delivery classes? What data will you want to transport during client copy?
What is view? Different types of view. Explain?
What are the contents in technical specifications?
Explain the difference between a pool table and a transparent table?
What are plan versions used for? : sap abap hr
What is an interface? In what scenario we use interface? What is the difference between abstract class and interface?
What is the diff between database view and maintenance view?
What are the different types of laws. What are they?
Explain what is a foreign key relationship? Explain this with the help of an example.
What is internal payroll process? : sap abap hr
what is difference between set screen and call screen ?
Explain how do you use structures in the abap programs?