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

C program, Write a program to find the area under the curve y = f(x) betwee...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Differences between batch systems versus real-time systems, Question 1: ...

Question 1: a. Give NINE general properties of an MIS b. Name and explain the THREE main Problems and Issues of EIS Question 2: a. What are information systems for?

Discuss about second generation electronic computers, Second Generation (19...

Second Generation (1954-1962) The second generation saw various significant developments at every level of computer system design, from technology used to build the basic circu

Why is catch almost always a bad idea, Why is catch (Exception) almost alwa...

Why is catch (Exception) almost always a bad idea?  Well, if at that point you know that an error has happened, then why not write the proper code to handle that error instead

Describe about second generation computers, Q. Describe about Second Genera...

Q. Describe about Second Generation Computers? Silicon brought advent of second generation computers. A two state device termed as a transistor was created from silicon. Transi

Data warehouse, 1) Define a job scheduling strategy that will meet business...

1) Define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a pict

Computer networks, distributed & centralized system in computer network

distributed & centralized system in computer network

Show the conditional jump in program with example, Q. Show the conditional ...

Q. Show the conditional jump in program? CMP    AX, BX                      ; compare instruction: sets flags JNE     FIX                             ; if not equal do addi

Explain the use of wire-center have any influence, Does the use of wire-cen...

Does the use of wire-center have any influence on the performance of a token ring? Explain. One problem along with a ring network is as if the cable breaks somewhere, the ring

Explain the fetch cycle, Q. Explain the Fetch Cycle? The beginning of e...

Q. Explain the Fetch Cycle? The beginning of every instruction cycle is the fetch cycle and causes an instruction tobe fetched from memory.   The fetch cycle comprises four

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