CHAR (The GNU Fortran Compiler)

### 8.64 `CHAR` — Character conversion function ¶

Synopsis:

  `RESULT = CHAR(I [, KIND])`

Description:

  `CHAR(I [, KIND])` returns the character represented by the integer I.

Class:

  Elemental function

Arguments:

  I | The type shall be `INTEGER`.
  KIND | (Optional) A scalar `INTEGER` constant expression indicating the kind parameter of the result.

Return value:

  The return value is of type `CHARACTER(1)`

Example:

      program test_char
          integer :: i = 74
          character(1) :: c
          c = char(i)
          print *, i, c ! returns 'J'
      end program test_char

Specific names:

  Name | Argument | Return type | Standard
  --- | --- | --- | ---
  `CHAR(I)` | `INTEGER I` | `CHARACTER(LEN=1)` | Fortran 77 and later

Notes:

  See `ICHAR` — Character-to-integer conversion function for a discussion of converting between numerical values and formatted string representations.

Standard:

  Fortran 77 and later

See also:

  `ACHAR` — Character in ASCII collating sequence,
  `IACHAR` — Code in ASCII collating sequence,
  `ICHAR` — Character-to-integer conversion function