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

Give the syntax switch statement, Give the syntax  switch statements C...

Give the syntax  switch statements Consider the following example. This is a function which converts an integer into a vague description. It is useful where we are only concer

Memory, #all type of memory

#all type of memory

Enumerate about the specialised hardware, Enumerate about the Specialised h...

Enumerate about the Specialised hardware Specialised hardware such as protected memory or cryptographic memory module for storing and protecting the keys proves to be a good s

Define pvm library routines, Q. Define PVM library routines? In this se...

Q. Define PVM library routines? In this segment we will give a short description of the routines in PVM 3 user library. Each PVM program must comprise the PVM header file 'pvm3

Why the tcp checksum is necessary, Is the TCP checksum necessary? Yes, ...

Is the TCP checksum necessary? Yes, TCP Checksum is essential. TCP layer is liable for error detection, transmission of packets if needed, error control, reassembly of packe

Explain difference between security and protection, Explain difference betw...

Explain difference between Security and Protection? Protection mechanism: The subsequent mechanisms are commonly utilized for protecting files having programs and data. (a

AWS, hosting on aws

hosting on aws

Define step by step procedure in computer programming, Define Step by Step ...

Define Step by Step Procedure in Computer Programming? The Computer programming is the skill and art of creating a computer program a defined set of instructions in source code

Show the mips addressing modes, Q. Show the MIPS Addressing Modes? MIP...

Q. Show the MIPS Addressing Modes? MIPS Addressing Modes MIPS employs various addressing modes: 1. Uses Register as well asimmediate addressing modes for operations.

Difference between narrative form and documentary form, Question: (a) E...

Question: (a) Explain clearly the difference between a Proposal and a Treatment for a video production project. (b) Explain clearly the difference between Narrative form an

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