byte_size_chr Function

private elemental function byte_size_chr(i) result(bytes)

Compute the number of bytes of a character variable.

 use penf
 print FI1P, byte_size('ab')

Arguments

TypeIntentOptionalAttributesName
character, intent(in) :: i

Character variable whose number of bytes must be computed.

Return Value integer(kind=I4P)

Number of bytes of c.


Called by

proc~~byte_size_chr~~CalledByGraph proc~byte_size_chr byte_size_chr interface~byte_size byte_size interface~byte_size->proc~byte_size_chr program~volatile_doctest~99 volatile_doctest program~volatile_doctest~99->interface~byte_size program~volatile_doctest~105 volatile_doctest program~volatile_doctest~105->interface~byte_size program~volatile_doctest~101 volatile_doctest program~volatile_doctest~101->interface~byte_size program~volatile_doctest~104 volatile_doctest program~volatile_doctest~104->interface~byte_size program~volatile_doctest~100 volatile_doctest program~volatile_doctest~100->interface~byte_size program~volatile_doctest~106 volatile_doctest program~volatile_doctest~106->interface~byte_size program~volatile_doctest~108 volatile_doctest program~volatile_doctest~108->interface~byte_size program~volatile_doctest~110 volatile_doctest program~volatile_doctest~110->interface~byte_size

Contents

Source Code


Source Code

   elemental function byte_size_chr(i) result(bytes)
   !< Compute the number of bytes of a character variable.
   !<
   !<```fortran
   !< use penf
   !< print FI1P, byte_size('ab')
   !<```
   !=> 2 <<<
   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
   endfunction byte_size_chr