Fortran User's Guide

Cray Character Pointers

If a pointee is declared as a character type, its Cray pointer is a Cray character pointer.

Purpose of Cray Character Pointers

A Cray character pointer is a special data type that allows f90 to maintain character strings by keeping track of the following:

An assignment to a Cray character pointer alters all three. That is, when you change what it points to, all three change.

Declaration of Cray Character Pointers

For a pointee that has been declared with an assumed length character type, the Cray pointer declaration statement declares the pointer to be a Cray character pointer.

  1. Before the Cray pointer declaration statement, declare the pointee as a character type with an assumed length.

  2. Declare a Cray pointer to that pointee.

  3. Assign a value to the Cray character pointer.

You can use functions CLOC or FCD, both nonstandard intrinsics.

Example: Declare Ccp to be a Cray character pointer and use CLOC to make it point to character string s.


	CHARACTER*(*) a
	POINTER ( Ccp, a )
	CHARACTER*80  :: s = "abcdefgskooterwxyz"
	Ccp = CLOC( s )

Operations on Cray Character Pointers

You can do the following operations with Cray character pointers:

 Ccp1 + i
 Ccp1 - i
 i + Ccp1
 Ccp1 = Ccp2
Ccp1 relational_operator Ccp2

where Ccp1 and Ccp2 are Cray character pointers and i is an integer.

Restrictions on Cray Character Pointers and Pointees

All restrictions to Cray pointers also apply to Cray character pointers. In addition, the following apply: