06.03.2014 Views

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Data Types, Constants, and Variables 3<br />

CHARACTER<br />

CHARACTER([LEN=]len)<br />

CHARACTER(LEN=len, KIND=n])<br />

CHARACTER(len, [KIND=]n)<br />

CHARACTER(KIND=n [, LEN=len])<br />

CHARACTER*len[,]<br />

n<br />

Is kind 1.<br />

len<br />

Is a string length (not a kind). For more information, see “Declaration Statements for Character<br />

Types”.<br />

If no kind type parameter is specified, the kind of the constant is default character.<br />

Character Constants<br />

A character constant is a character string enclosed in delimiters (apostrophes or quotation marks).<br />

It takes one of the following forms:<br />

[k_]'[ch...]' [C]<br />

[k_]"[ch...]" [C]<br />

k<br />

Is the optional kind parameter: 1 (the default). It must be followed by an underscore ( _ ). Note<br />

that in character constants, the kind must precede the constant.<br />

ch<br />

Is an ASCII character.<br />

C<br />

Is a C string specifier. C strings can be used to define strings with nonprintable characters. For<br />

more information, see “C Strings in Character Constants”.<br />

Rules and Behavior<br />

The value of a character constant is the string of characters between the delimiters. The value does<br />

not include the delimiters, but does include all blanks or tabs within the delimiters.<br />

If a character constant is delimited by apostrophes, use two consecutive apostrophes ('') to place an<br />

apostrophe character in the character constant.<br />

Similarly, if a character constant is delimited by quotation marks, use two consecutive quotation<br />

marks ("") to place a quotation mark character in the character constant.<br />

3-15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!