Next: , Previous: KIND, Up: Intrinsic Procedures


8.73 LOC — Returns the address of a variable

Description:
LOC(X) returns the address of X as an integer.
Option:
gnu
Class:
inquiry function
Syntax:
I = LOC(X)
Arguments:

X Variable of any type.

Return value:
The return value is of type INTEGER(n), where n is the size (in bytes) of a memory address on the target machine.
Example:
          program test_loc
            integer :: i
            real :: r
            i = loc(r)
            print *, i
          end program test_loc