Monday 15 March 2021

Parameter Passing Methods in PPL or Programming Language | Subprograms | PPL | Sebesta

                     In this post, we will see Parameter Passing Methods in PPL or Programming Language | Subprograms |  PPL | Sebesta | parameter passing methods, subprograms, ppl, sebesta, parameter passing methods, parameter passing methods in programming language, parameter passing mechanism, parameter passing methods in ppl, explain various parameter passing methods   


4. Parameter passing methods.


 

i. Pass By Value / Call By Value

              When a parameter is passed by value, the value of the actual parameter is used to initialize the corresponding formal parameter, which then acts as a local variable in the subprogram, thus implementing in-mode semantics.

 

ii. Pass By Result

              Pass-by-result is an implementation model for out-mode parameters.

 

e.g. C# code

 

void Fixer(out int x, out int y) {

x = 17;

y = 35;

}

. . .

f.Fixer(out a, out a);

 

iii. Pass By Value-Result

              Pass-by-value-result is an implementation model for inout-mode parameters in which actual values are copied.

 

iv. Pass By Reference

              Pass-by-reference is a second implementation model for inout-mode parameters.

 

v. Pass By Name

              Pass-by-name is an inout-mode parameter transmission method.

              When parameters are passed by name, the actual parameter is, in effect, textually substituted for the corresponding formal parameter in all its occurrences in the subprogram.

 


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=etW6Gfu_e30

No comments:

Post a Comment