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

Implementation for the prime machine, Write an implementation for the Prime...

Write an implementation for the Prime machine (de?ned at the end of the assignment sheet). Provide a suitable invariant and variant for any loop you use. Provide comments in your m

Artificial intelligence, 2. The Turing test has often been incorrectly inte...

2. The Turing test has often been incorrectly interpreted as being a test of whether or not a person could distinguish between responses from a computer and responses from a person

Differences b/w user level and kernel supported threads, What are the diffe...

What are the differences between user level threads and kernel supported threads? A thread, sometimes termed a lightweight process (LWP), is a fundamental unit of CPU utilizati

Numbers of students must be integer, A school district has I neighbourhoods...

A school district has I neighbourhoods, J schools and G grades at every school. Every school j has a capacity of C jg for grade g. In every neighbourhood i, the student population

What are the important tools of a three-tier client server, What are the im...

What are the important tools of a three-tier client server? In a three-tier or multi-tier environment, there the client implements the presentation logic or the client. The bus

What is software quality assuranc, Software QA includes the whole software ...

Software QA includes the whole software development PROCESS - improving and monitoring the process, making sure that any agreed-upon standards and processes are followed, and ensur

Software, S oftware In 1970s less than 1 percent of the public could h...

S oftware In 1970s less than 1 percent of the public could have intelligently explained what "computer software " means. Nowadays most professionals and various member of the

What is artificial intelligence fuzzy logic, Fuzzy logic is a form of vario...

Fuzzy logic is a form of various-valued logic; it deals with reasoning that is approximate rather than fixed & exact. In contrast with traditional logic theory, where binary sets h

State the basic properties of this analytical engine, State the basic prope...

State the basic properties of this analytical engine The basic properties of this analytical engine are: It was a common purpose programmable machine. It had provisi

What is a unix device driver, A UNIX device driver is ? Ans. A UNIX devi...

A UNIX device driver is ? Ans. A UNIX device driver is structured in two halves termed as top half and bottom half.

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