IACHAR (The GNU Fortran Compiler)

### 8.144 `IACHAR` — Code in ASCII collating sequence ¶

Synopsis:

  `RESULT = IACHAR(C [, KIND])`

Description:

  `IACHAR(C)` returns the code for the ASCII character in the first character position of `C`.

Class:

  Elemental function

Arguments:

  C | Shall be a scalar `CHARACTER`, with `INTENT(IN)`
  KIND | (Optional) A scalar `INTEGER` constant expression indicating the kind parameter of the result.

Return value:

  The return value is of type `INTEGER` and of kind KIND. If KIND is absent, the return value is of default integer kind.

Example:

      program test_iachar
        integer i
        i = iachar(' ')
      end program test_iachar

Notes:

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

Standard:

  Fortran 95 and later, with KIND argument Fortran 2003 and later

See also:

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