5 ! Contributed by John Chludzinski, using the code of John Reid
8 CHARACTER(LEN
=:),ALLOCATABLE
:: str
9 if (s_to_c("ABCdef") /= "ABCdef" .or
. len(s_to_c("ABCdef")) /= 6) call abort()
10 str
= s_to_c("ABCdef")
11 if (str
/= "ABCdef" .or
. len(str
) /= 6) call abort()
12 str(1:3) = s_to_c("123")
13 if (str
/= "123def" .or
. len(str
) /= 6) call abort()
17 PURE
FUNCTION s_to_c(string
)
18 CHARACTER(LEN
=*),INTENT(IN
) :: string
19 CHARACTER(LEN
=:),ALLOCATABLE
:: s_to_c