c_free_string Subroutine

private subroutine c_free_string(c_string) bind(C, name="c_free_string")

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(inout) :: c_string

Source Code

   SUBROUTINE c_free_string(c_string) BIND(C, name="c_free_string")
      TYPE(c_ptr), INTENT(INOUT)             :: c_string

      CHARACTER(:, kind=c_char), POINTER :: string

      CALL c_f_pointer(c_string, string)
      DEALLOCATE (string)
      c_string = c_null_ptr

   END SUBROUTINE c_free_string