Skip to main content

Pointers to Structures

  • Chapter
Upgrading to Fortran 90
  • 249 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics