127. A derived type can have derived type components.#

topic: Derived types

Note

This tip is a draft1.

A derived type may have components that are also derived types. If x is an instance of a derived type that has component y, and y has component z, you can write x%y%z to access z. A similar syntax applies with type extension of Fortran 2003.



1

From the perspective of FortranTip Browser, “draft” means that it hasn’t been edited for formatting, hasn’t had corresponding Fortran programs added, the text content hasn’t been enhanced, etc. Draft texts are extracted from the corresponding Tweet using the Twitter API.