Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Explain different parameter passing mechanisms to a function with the help of example?
The different parameter-passing mechanisms are given below:
1. Call by value
2. Call by value-result
3. Call by reference
4. Call by name
In first call by value mechanism, the values of real parameters are passed to the called function. These values are allocated to the consequent formal parameters. If a function changes the value of a formal parameter, the modification is not reflected upon the consequent actual parameter. It is commonly utilized for built-in functions of the language. Its major advantage is its simplicity. The compiler can use formal parameter like a local variable. It simplifies compilation considerably.
Call by value-result: This mechanism extends the abilities of the call by value mechanism through copying the values of formal parameters back in consequent actual parameters at return. Such mechanism inherits the simplicity of the first mechanism i.e. but incurs higher overheads.
Call by reference: Now the address of an actual parameter is passed to the called function. If the parameter is an expression, its value is calculated and stored in a temporary location and the address of the temporary location is passed to the called function. If the parameter is an array component, its address is likewise calculated at the time of call. Such mechanism is very popular since this has 'cleaner' semantics than call by value-result.
Call by name: Such parameter transmission mechanism has similar effect as if every occurrence of a formal parameter in the body of the called function is replaced through the name of the consequent actual parameter. The actual parameter consequent to a formal parameter can change dynamically throughout the execution of a function. It makes the call through name mechanism immensely powerful. Though, the high overheads make this less attractive in practice.
Why object oriented development not only allows reuse In a wider way we can say that object oriented development not only allows reuse and information sharing within an applica
Q. Explain Extended Binary Coded Decimal Interchange Code? Extended Binary Coded Decimal Interchange Code (EBCDIC) is a character-encoding format employed by IBM mainframes. It
Problem 1 a) What is the purpose of the CPU and what can the CPU perform. b) Name the two most common types of software and briefly illustrate each one. c) The CPU con
Design a 4 : 1 multiplexer with strobe input using NAND gates. Ans. Design of 4 : 1 multiplexer with strobe input using NAND gates.
Explain Top down parsing. Top down parsing: Specified an input string, top down parsing tries to derive a string identical to this by successive application of grammar rule
Q. Write a pseudo code to find sum of two functions? Let's write a pseudo code to find sum of two functions f(A) + f(B). In first algorithm we will not use locking. Process
What are the two different ways of building a match code object? A match code can be built in two dissimilar ways: Logical structure: The matchcode data is set up not pe
What is ASP.NET Authentication Providers and IIS Security? ASP.NET implements authentication using authentication providers, which are code modules that verify credentials and
Explain the term- Scan Insertion Scan Insertion is completed by a tool and results in all (or most) of your design's flip-flops to be changed by special "Scan Flip-flops". Sca
Why a function canot have delays? However in Open Vera, delays are allowed in function. A function returns a value and hence can be used as a part of any expression. This doesn
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!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd