Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Of the two call transaction and session method, which is faster?

1198


Explain the types of bdc's?

1022


Does sap handle multiple currencies?

1026


Explain get pernr concept when we use logical data base? : abap hr

1224


Can we use transfer dataset to transfer data in internal table ?

2105


What are the layers of data description in r/3? : abap data dictionary

1125


What type of user exits have you written ?

1928


Print options in smartforms?

2006


Abstract class and interface, multiple inheritance, live example

1341


Can we call reports and transactions from interactive reporting lists?

1121


What are the two ways for restricting the value range for a domain? : sap abap data dictionary

1286


What is protect & endprotect?

1016


Difference between .Include and .append?

1249


What is table buffer?

1020


Is the basic list deleted when the new list is created?

1110