NULLIFY

Purpose

The NULLIFY statement causes pointers to become disassociated.

Syntax

Read syntax diagramSkip visual syntax diagramNULLIFY(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, default initialization 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