private helper functions cast char to byte (8-bits integer in Fortran) display: private
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=c_char,len=1), | intent(in) | :: | char |
pure function cast_byte(char) result(byte)
character(kind=c_char, len=1), intent(in) :: char
integer(kind=c_int8_t) :: byte
byte = transfer(char, byte)
end function cast_byte