Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

CHARACTER

Statement: Specifies the CHARACTER data type.

CHARACTER ([LEN=]len [, [KIND=]n])

CHARACTER (KIND=n [, [LEN=]len])

CHARACTER* len

n

Is kind 1.

len

Is a string length (not a kind). For more information, see Declaration Statements for Character Types.

If no kind type parameter is specified, the kind of the constant is default character.

Example

C
C   Length of wt and vs is 10, city is 80, and ch is 1
C
    CHARACTER wt*10, city*80, ch
    CHARACTER (LEN = 10), PRIVATE :: vs
    CHARACTER*(*) arg !declares a dummy argument
C   name and plume are ten-element character arrays
C   of length 20
    CHARACTER name(10)*20
    CHARACTER(len=20), dimension(10):: plume
C
C   Length of susan, emily, and naomi are 2, karen is 12,
C   olivia is a 79-member array of length 2
C
    CHARACTER(2) susan, emily, karen*12, naomi, olivia(79)