Abstract
Chapter 10 gave several examples of pointers to variables of intrinsic types, and this chapter will discuss pointers to variables of derived types. A representative example of a declaration of a pointer to a structure is
TYPE (employee_type), POINTER :: ptr
This specifies that ptr is a pointer that is capable of pointing to any scalar variable of type employee_type. However, ptr can never point to a variable of another derived type, and of course, it cannot point to a variable of any intrinsic type. Furthermore, ptr can never point to any array, not even to an array of type employee_type. This is because a Fortran 90 pointer is permitted to point only to a data object of a particular rank, and ptr can point only to a data object of rank 0 (that is, to a scalar) as indicated by the absence of array extent specifications in its declaration.
Keywords
Root Node Binary Tree Storage Area Left Child Print StatementPreview
Unable to display preview. Download preview PDF.