The scope of a variable determines what parts of the
program can access it directly. Its sometimes referred to
In FORTRAN the concept
of scope is very rudimentary, variables are either:-
In C++ the concept is much richer. Variables can be:-
- local - declared within a subroutine or function and only visible
to that routine
- global - declared in a COMMON block and visible to any routine
that includes the COMMON
- global - visible to any code so long as the appropriate
- file - visible within the file in which it is defined.
- class - visible within a class object.
have class scope.
- local - visible only within the function in which it is defined
and restricted to the innermost
that encloses the definition.
Go Back to the
The Glossary Top Page
If you have any comments about this page please send them to