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 / 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 |
write string class as your own class in java without using any built-in function
What are the benefits of polymorphism?
explain sub-type and sub class? atleast u have differ it into 4 points?
Please send ford technologies placement paper 2 my mail id
What is polymorphism give a real life example?
how do u initialize the constant variables
What normal C constructs work differently in C++?
1. Strong name 2. how to prevent a class from being inherited 3. delegates 4. default modifier for interface 5. default modifier for class 6. base class for exception 7. diff bet trigger and view in sql 8. how to exchange values from one page to another page 9. can multiple catch block ll be executed at same time 10. can u store different data types in an array & array list 11. when we ll use trigger 12. try,catch,finally usage
How do you define a class in oop?
what is the new version of oops
oops concept is used for?
what is the difference between inter class and abstract class...?