cpack Interface

public interface cpack

Convert a character(len=*) to character, dimension(:)

A routine requirement for creating pointers to character storages. One can convert from len=* to an array of len=1 and back using cunpack.

Because fortran requires dimensions of arrays assignments to be same size it one has to specify ranges if the length of the character is not equivalent to the size of the array.

Example:

 character(len=20) :: a
 character :: b(10)
 a = 'Hello'
 b(1:5) = cpack('Hello')


Contents


Module Procedures

private function cpack_(c) result(car)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: c

Return Value character(len=1) (len(c))