CS 3304: Comparative Languages
Subprograms
[
Course Documents
] : [
Subprograms
]
Previous
Contents
Next
Keyword Index
Methods for Accessing Nonlocals
FORTRAN COMMON
The only way in pre-90 FORTRANs to access nonlocal variables
Can be used to share data or share storage
Static scoping--discussed in Chapter 4
External declarations: C
Subprograms are not nested
Globals are created by external declarations (they are simply defined outside any function)
Access is by either implicit or explicit declaration
Declarations (not definitions) give types to externally defined variables (and say they are defined elsewhere)
External modules: Ada and Modula-2: Sec Ch. 10
Dynamic Scope: discussed in Ch. 4