cast_byte Function

public pure function cast_byte(char) result(byte)

private helper functions cast char to byte (8-bits integer in Fortran) display: private

Arguments

TypeIntentOptionalAttributesName
character(kind=c_char,len=1), intent(in) :: char

Return Value integer(kind=c_int8_t)


Contents

Source Code


Source Code

    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