Parameter Passing: Difference between revisions
→Example Fortran
Line 150:
===Example [[Fortran]]===
Early versions of the language used only by reference parameter passing for the arguments, but the formal parameters were copied locally and then copied back to the actual parameters at the end of the call. This is also known as "call by value result" or "call by copy-restore".
Starting from Fortran 90 (and later), functions and subroutines can specify an ''intent'' for the argument; intent can be: '''in''' (
Trying to modify an argument with ''intent in'' triggers an error at compile time.
|