IBM

  www.ibm.com
  www.ibm.com

Interview Question

Software Engineer Interview

Why would one use pass by reference instead of pass by

  value?
Answer

Interview Answer

3 Answers

0

Passing by reference allows a function to manipulate multiple arguments beyond the local scope, which can be useful when the function needs to return or modify multiple elements.

Interview Candidate on Jul 17, 2013
0

What was the project given to you ?

mriacle404 on Jul 3, 2014
0

In the case that you pass objects, using call by value can be expensive as a bit-wise-copy constructor is created. Passing by reference is also memory efficient.

Arvind on Oct 16, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.