Next: Arrays as Arguments
Up: Arrays as Arguments
Previous: Arrays as Arguments

Array Elements as Arguments

It should come as no surprise that it is possible to pass an element of an array as an argument. In fact, you already know everything that you need to know about this aspect of Fortran. Why is that?

Click here for the answer

To drive this point home, take a look at ``aparm1.f'' in your ``examples'' directory (or view it directly). Notice that the main program calls the subroutine ``swap'' twice---once with a pair of simple integer variables as arguments, and once with a pair of integer array elements as arguments.

Compile and run the program. This is a simple example, but be sure that you appreciate the point it is making.


Next: Arrays as Arguments
Up: Arrays as Arguments
Previous: Arrays as Arguments

Hamlet Project
hamlet@cs.utah.edu