NULLIFY

Purpose

The NULLIFY statement causes pointers to become disassociated.

Syntax

Read syntax diagramSkip visual syntax diagram>>-NULLIFY--(--pointer_object_list--)--------------------------><
 

pointer_object
is a pointer variable name or structure component

Rules

A pointer_object must be definable and have the POINTER attribute.

A pointer_object must not depend on the value, bounds, or association status of another pointer_object in the same NULLIFY statement.

Tip

Always initialize a pointer with the NULLIFY statement, pointer assignment, FORTRAN 95 Begins default initialization FORTRAN 95 Ends or explicit initialization.

Examples

TYPE T
  INTEGER CELL
  TYPE(T), POINTER :: NEXT
ENDTYPE T
TYPE(T) HEAD, TAIL
TARGET :: TAIL
HEAD%NEXT => TAIL
NULLIFY (TAIL%NEXT)
END

Related information