char(i [, kind])
returns the character represented by the integer i
.
FORTRAN 77 and later
result = char(i [, kind])
i
- The type shall be integer
.kind
- (Optional) An integer
initialization expression indicating the kind parameter of the result.The return value is of type character(1)
program test_char
integer :: i = 74
character(1) :: c
c = char(i)
print *, i, c ! returns 'J'
end program test_char
See ichar for a discussion of converting between numerical values and formatted string representations.