toCString

Convert a D string to a zero terminated C string, with allocation parameter.

char*
toCString
(
string dstr
,
Flag!"Alloc" alloc
)

Parameters

dstr string

String to convert

alloc Flag!"Alloc"

Yes.Alloc if string is being transferred to C (use g_malloc), No.Alloc for D allocation (no transfer)

Return Value

Type: char*

Zero terminated C string (D or C allocation)