"Passing Data" Please respond to the following:

Computer Science
Tutor: None Selected Time limit: 1 Day

Passing arguments is a standard method used in all programming languages.Explain the difference when you use these two (2) methods: passing an argument by value and passing data by reference.Provide an example of each type.

Jun 8th, 2015

Passing by value actually passes a copy of an argument.
Passing by reference actually passes the address of an argument.

So the differences is:
1) when passing by value an argument always remains unchanged, when by reference can be changed;
2) if an argument is class or structure, then for passing by value a copy constructor is necessary (direct or indirect);
3) If an argument is large (structure) then passing by value requires more memory.

Jun 8th, 2015

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
Jun 8th, 2015
...
Jun 8th, 2015
Dec 2nd, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer