Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | i | Character variable whose number of bytes must be computed. |
Number of bytes of c.
Compute the number of bytes of a character variable.
elemental function byte_size_chr(i) result(bytes)
!---------------------------------------------------------------------------------------------------------------------------------
!< Compute the number of bytes of a character variable.
!---------------------------------------------------------------------------------------------------------------------------------
character(*), intent(in) :: i !< Character variable whose number of bytes must be computed.
integer(I4P) :: bytes !< Number of bytes of c.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
bytes = bit_size(i)/8_I4P
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction byte_size_chr