Just a test of f_string_to_c_ptr.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=c_int), | intent(in), | value | :: | ival | ||
type(c_ptr), | intent(inout) | :: | buffer |
a preallocated string buffer |
subroutine return_a_string(ival,buffer) bind(c,name='return_a_string') implicit none integer(c_int),intent(in),value :: ival type(c_ptr),intent(inout) :: buffer !! a preallocated string buffer call f_string_to_c_ptr(repeat('*',ival),buffer) end subroutine return_a_string