answersLogoWhite

0


Best Answer

Passing by value is where you pass the actual value (be it an integer, an array, a struct, etc.) to a function. This means that the value must be copied before the function is called and therefore the value in the caller cannot be modified within the callee. Passing by reference is where a reference/pointer to a value is passed to a function. The reference often takes up less space than copying the actual value (particularly when the value is a struct or an array) and allows you to manipulate the value in the caller within the callee.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between passing by value and passing by difference?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the difference between passing an array and passing single value data to a function?

Passing a single value to a function is often just a simple integer. But passing an array, character string or other data structure is typically "pass by reference", or in other words, the calling statement will 'point to' the place in memory where the data structure resides.When a function is called using a pointer to a data structure, both the calling environment and the called function are referencing the same data; any changes made to the data in the structure by the function will have changed the data that the original calling environment sees.However, when a value is passed to a function, the function creates it's own copy of the value, and can change it in any way without changing the original value.


What is the use of passing an argument by value?

Passing an argument by value means that the method that receives the argument can not change the value of the argument. Passing an argument by reference means that the method that receives the argument can change the value of the incoming argument, and the argument may be changed in the orignal calling method.


What is difference between plus plus you and you plus plus?

Both ++you and you++ have the same ending result. The variable you is incremented. The difference is that, if you use the combination in a larger expression, then you++ will have the initial value of you, while ++you has the incremented value of you.


What is the zero value in quantity surveying?

Difference between BOQ cost and actual cost (after execution)


When a function does not return a value what kind of function is it called?

In most computer languages, a procedure that returns a value is called a function and a procedure that does not return a value is called a subroutine or subprogram. Usually the languages treat the passing of arguments/parameters differently between functions and subroutines. The C language does not distinguish between them. A subroutine that does not return a value is define as a "void" function indicating that no return value is used or available.

Related questions

What is the difference between passing on and passing away?

To some people, there is no difference.. both mean dying. To others, the difference is that "passing away" means simply dying and "passing on" refers to going to the afterlife.


What is the difference between a fuse and circuit?

a fuse main purpose is to quickly disconnect a short circuit. when the current passing through it exceed its rated value


What the difference between actual value and earned value?

The difference between the Actual Value & Earned Value is the Project Cost Variance


What is the difference between the place value and face value of 9 in 309812?

the DIFFERENCE between the place value and the face value is 991


What is the difference between ethical value and value?

search


What is the difference between a blackout and passing out?

restigte stand 4 blackout & passing out stands 4 pass to anoyher level


The difference between what the workers produce and what they earn is surplus value?

Surplus value is the difference between the value that workers produce and what they are paid in wages.


What difference value between K and Ct?

the same as the difference between ct and k


Is a D a passing grade for 9th grade?

A D is a passing grade for 9th grade. It is the overall average of all grades that makes the difference between passing and repeating a grade.


What is the difference between 0.3 and 0.30?

There is no difference because they are of equal value


The difference between an observed or calculated value and a true value?

error


What is the difference between the face value and the value of 5 in 3508?

495