to_c_string Interface

public interface to_c_string

Converts a Fortran string to a C-compatible, null-terminated string.


Contents


Module Procedures

private pure function char_to_c_string(x) result(rst)

Converts a Fortran string to a C-compatible, null-terminated string.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: x

The string to convert.

Return Value character(kind=c_char, len=1), allocatable, dimension(:)

The resulting C string.

private pure function string_to_c_string(x) result(rst)

Converts a Fortran string to a C-compatible, null-terminated string.

Arguments

Type IntentOptional Attributes Name
type(string), intent(in) :: x

The string to convert.

Return Value character(kind=c_char, len=1), allocatable, dimension(:)

The resulting C string.