POINTER attribute
Standard: F77 F90 F95 F2003
  Example Program
<Syntax>
type, POINTER [ , attr ] :: decl-list

POINTER [ :: ] ptr-decl [ , ptr-decl ]...

ptr-decl ::= name [ ( deferred-shape ) ]
<Semantics>

The POINTER attribute specifies that an entity is a pointer. At runtime, a pointer may be associated with a target (by allocation or pointer assignment), may be disassociated (by NULLIFY or by pointer assignment from another disassociated pointer) or it may have undefined association status. A pointer that is not associated must not be referenced or defined.

A pointer that is an array has its rank specified (by a deferred shape spec), but it has no bounds or shape until it is associated with a target array.

A pointer can only become associated with variables that have the TARGET attribute. Allocating a pointer creates a new variable that implicitly has the TARGET attribute.

In Fortran 2003, a character pointer can have “deferred length”, specified by a length type parameter of ‘:’. Such a pointer has no length until it is associated with a target.

<Related>
ALLOCATE statement, Component Definition statement, DEALLOCATE statement, DIMENSION attribute, NULL intrinsic function, NULLIFY statement, Pointer assignment statement (=>), TARGET attribute, Type Declaration statement