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

Find minimum number of resource so that no deadlock arise, An operating sys...

An operating system contains 3 user processes each requiring 2 units of resource R. The minimum number of units of R such that no deadlocks will ever arise is? Ans. The minimum

Paging supervisor - computer architecture, Paging supervisor: This par...

Paging supervisor: This part of the operating system built and manages the page tables. If the  due to dynamic address translation hardware a page fault occurs exception then

Show error detection mechanism, Q. Show Error detection mechanism? Erro...

Q. Show Error detection mechanism? Error detection mechanism can be described as below: Figure: Error detection and correction

Grounding a variable - first-order logic, Grounding a variable - first-orde...

Grounding a variable - first-order logic: The perform of making ourselves clear about a variable by introducing an exists or a forall sign is called quantifying the variable.

Name the 7400 series TTL chip, Name the 7400 series TTL chip which is a pri...

Name the 7400 series TTL chip which is a priority encoder. Write its truth table.  Ans. Available IC in 74 series is 74147 that is a priority encoder. Such I

linq file extension, What is the LINQ file extension that interacts with C...

What is the LINQ file extension that interacts with Code Behinds objects? Ans) The extension of the file is .dbml

Determine the define byte - assembler directives, Determine the Define Byte...

Determine the Define Byte - Assembler directives DB (Define Byte): DB directive defines a byte-type variable (i.e. a variable that occupies one byte of memory space). In a give

Give an example of first fit and best fit algorithms, Given memory partiti...

Given memory partitions of 100k, 500k, 200k, 300k, and 600k (in order), apply first fit and best fit algorithms to place processes with the space requirement of 212k, 417k, 112k an

Eme, state function and path function

state function and path function

Input device used in computer system, Input device used in computer system:...

Input device used in computer system: An input device is typically a mouse or keyboard, the input device is the conduit through which data and instructions enter a computer. A

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