in Programming in C edited by
1,139 views
1 vote
1 vote

What type of parameter passing mechanism (call-by-value, call-by-reference, call-by-name, or-by-value result) is the following sequence of actions trying to implement for a procedure call $P (A[i])$ where P (i:integer) is a procedure and A is an integer array?

Is the implementation correct? Explain and correct it if necessary. You are supposed to make only small changes

  1. Create a new local variable, say z.
  2. Assign to z the value of A[i].
  3. Execute the body of P using z for A[i]
  4. Set A[i] to z.​

in Programming in C edited by
1.1k views

1 Answer

2 votes
2 votes

implement the call by value result parameter passing technique 
as value is first copied
all changes done in local variable
and then again value copied in actual variable

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true