edited by
1,187 views
1 votes
1 votes

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.​

edited by

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

0 votes
0 votes
1 answer
2
9 votes
9 votes
2 answers
4
Kathleen asked Sep 13, 2014
3,472 views
Start and stop bits do not contain any "information" but are used in serial communication forError detectionError correctionSynchronizationSlowing down the communications...