What is the difference between pass by reference and pass by
value?

Answer Posted / anwer sayed

Pass By Reference :
In Pass by reference address of the variable is passed to a
function. Whatever changes made to the formal parameter will
affect to the actual parameters
- Same memory location is used for both variables.(Formal
and Actual)-
- it is useful when you required to return more then 1 values
Pass By Value:
- In this method value of the variable is passed. Changes
made to formal will not affect the actual parameters.
- Different memory locations will be created for both variables.

Read more:
http://wiki.answers.com/Q/What_is_the_difference_between_pass_by_value_and_pass_by_reference_in_c#ixzz16MOpWSLk

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of polymorphism?

573


What is and I oop mean?

616


What is class in oop with example?

616


What is interface in oop?

660


Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

1782






What is super in oop?

595


Can main method override?

583


What is persistence in oop?

669


What is overloading in oops?

596


What is the difference between inheritance and polymorphism?

587


What do you mean by variable?

572


Write a program to reverse a string using recursive function?

1790


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6145


What is stream in oop?

837


What is the importance of oop?

607