Explain call by value and call by reference, Computer Engineering

Assignment Help:

Call by value and Call by reference

Call by value means sending the values of the arguments- The value of each of the original arguments in the calling function is copied into corresponding formal arguments of the called function. The modification made to the formal arguments has no effect on the values of actual arguments in the calling function.  This method of passing arguments is called call by value verified by swap (int x, int y) function in the following example. 

Call by reference means sending the addresses of the arguments- the addresses of actual arguments in the calling function are copied into formal arguments of the called function. Using these addresses we are really working on actual argument so changes will be reflected in the calling function.

 


Related Discussions:- Explain call by value and call by reference

Determine a sample rate required for telephone conversation, A sample rate ...

A sample rate of            is required for a good quality representation of telephone conversation. A sample rate of 50 times/second /mile of distance travelled are needed fo

Explain about variable-length of instructions, Q. Explain about Variable-Le...

Q. Explain about Variable-Length of Instructions? With the better understanding of computer instruction sets designers developed the idea of having a range of instruction forma

What is efi framework, The Extensible Firmware Interface (EFI) is a specifi...

The Extensible Firmware Interface (EFI) is a specification that defines a software interface among an operating system and platform firmware. EFI is intended as a significantly imp

How a direct inward dialling is utilized, Direct inward dialling is used as...

Direct inward dialling is used as a feature in? Direct inward dialling is utilized as a feature in EPABX.

Control signals from control bus, Control Signals from Control Bus: A numb...

Control Signals from Control Bus: A number of the control signals are provided to control unit by the control bus. These signals are issued from outside the CPU.  Some of these si

Example on multi-statement forall construct, Q. Example on Multi-statement ...

Q. Example on Multi-statement FORALL construct? The subsequent statements set every element of matrix X to sum of its indices.  FORALL (i=1:m, j=1:n)      X(i,j) = i+j an

Advantage of wrapping database calls into mts transactions, Advantage of wr...

Advantage of wrapping database calls into MTS transaction If database calls are complete within the context of a transaction, aborting the transaction will undo and changes that

How online databases work, How Online Databases Work? An online or web-...

How Online Databases Work? An online or web-based database keeps data on a cloud of servers somewhere on the Internet, which is accessible by any authorized user with an Intern

Python implementation of a solver for the desert cro, Python implementation...

Python implementation of a solver for the desert crossing, Python Programming #Minimum 100 words accepted#

What are the event key words in interactive reporting, What are the event k...

What are the event key words in interactive reporting? Event Keyword                                                 Event AT LINE-SELECTION         Moment at which the u

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd