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

What is race condition, What is Race condition? Race condition: The c...

What is Race condition? Race condition: The circumstances where several processes access - and manipulate shared data-concurrently. The last value of the shared data depends

What is null pointer, What is NULL POINTER Inside main, a FILE * called...

What is NULL POINTER Inside main, a FILE * called file. Afterwards, the fopen function, passing it the path to data file, as well as "r", only intending to read from the file.

Keyboard status word generator, Q.  Write short note on Interfacing Keyboar...

Q.  Write short note on Interfacing Keyboard, giving block diagram. Why do we need to introduce circuitry called Keyboard Status Word Generator?

What is a disk drive, What is a disk drive? The electro mechanical mech...

What is a disk drive? The electro mechanical mechanism that spins the disk and moves the read/write heads known as disk drive.

Define the method of implementation, Define the method of Implementation ...

Define the method of Implementation Once "final" system has been designed it is then essential to put together the software and hardware and introduce the new system. There ar

Describe the functionality of software testing, What do you do if you have ...

What do you do if you have given functionality that wasn't listed in the requirements? - If the functionality isn't essential to the purpose of the application, it should be re

Explain bottom up parsing, Explain Bottom up parsing. Bottom up pars...

Explain Bottom up parsing. Bottom up parsing: This parse attempts to increase syntax tree for an input string by a sequence of reduction. If the input string can be decreas

Sun and nis law, Q. What is Sun and Nis Law? The Sun and Ni's Law is a ...

Q. What is Sun and Nis Law? The Sun and Ni's Law is a simplification of Amdahl's Law and Gustafson's Law. The basic concept underlying Sun and Ni's Law is to find solution to a

C program, program for finding the area under the curve   #includ...

program for finding the area under the curve   #include float start_point, /* GLOBAL VARIABLES */ end_point, total_area; int

Breakthrough for computer engineering, what is the importance of chemistry ...

what is the importance of chemistry for computer engineering?

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