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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 1995 Springer-Verlag New York, Inc.
About this chapter
Cite this chapter
Redwine, C. (1995). Pointers to Structures. In: Upgrading to Fortran 90. Springer, New York, NY. https://doi.org/10.1007/978-1-4612-2562-1_11
Download citation
DOI: https://doi.org/10.1007/978-1-4612-2562-1_11
Publisher Name: Springer, New York, NY
Print ISBN: 978-0-387-97995-3
Online ISBN: 978-1-4612-2562-1
eBook Packages: Springer Book Archive