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...

What is the difference between pass by value,pass by
pointer,pass by reference in the catch block in the
exception handling in c++

Answer Posted / guest

$ pass by value: it does not change the content of the
argument variable in the calling function even if they
changed in the called function.Because the content of the
actual parameter in the caller is copied to the
formalparameter of the callee.
so change to the parameter withen the function
will effect only the copy.

$ pass by pointer or pass by address:in this the address of
actual parameters is passed i.e address of the variable
copied in the called function.
so any change to the parameter within the
function will reflect to the caller function parameter i.e
actual parameters are modified.

$ pass by referance : it has syntax of pass by value and
funcionality of pass by pointer.
i.e
the referance type formal parameter are accessed in the same
way as normal value parameters but if any change to them
will also reflected to the actual parameter.

see the diff:

P by V:
int main()
{
int a,b;
f(a,b);//caller
}
f(int x, int y);//called

$P by P:

int main()
{
int a,b;
f(&a,&b);//caller
}
f(int *x, int *y);//called

$ P by R:

int main()
{
int a,b;
f(a,b);//caller
}
f(int &x, int &y);//called

Is This Answer Correct ?    16 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between procedural programming and oops?

1121


What are the 5 oop principles?

1119


to find out the minimum of two integer number of two different classes using friend function

2122


class type to basic type conversion

2397


Can an interface inherit a class?

1053


Which is better struts or spring?

1050


What is abstraction encapsulation?

1113


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

4921


Is oop better than procedural?

1032


I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...

2106


Why multiple inheritance is not possible?

1064


What is encapsulation in oop?

1041


How many human genes are polymorphic?

1051


What is use of overloading?

1134


write a program to find 2 power of a 5digit number with out using big int and exponent ?

2367