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')
This is a requirement because it is not possible to create a unified pointer
to arbitrary length characters. Hence we store all len=* variables as len=1 character arrays.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | c |