Next: Different Variables
Up: COMMON Blocks
Previous: COMMON Blocks

Different Variable Names

Take a look at ``common2.f'' (or view it directly). How does it differ from ``common1.f''?

Click here for the answer

All that the MATRIX common block does in this case is set aside room for 25 REAL numbers. It doesn't care that those numbers are viewed as an array A in one place, and array B in another place, and an array C in another place.

Even though Fortran doesn't care, you should. It is generally bad practice to use different names for the same global variable in different parts of the program. Can you think of a reason why?

Click here for the answer


Next: Different Variables
Up: COMMON Blocks
Previous: COMMON Blocks

Hamlet Project
hamlet@cs.utah.edu