charPtr

char* version of wcharPtr. Basically it appends a \0 to the input. The function uses malloc for strings of lengths 1024 and above.

  1. auto charPtr(void* buffer)
  2. immutable(char)* charPtr()
    @nogc nothrow
    immutable(char)*
    charPtr
    (
    alias str
    )
    ()
    if (
    __traits(compiles, )
    )
  3. StackBufferEntry!char charPtr(const(char)[] str, SB sb)

Parameters

str

The source string to convert to a C UTF-8 string

Note: Do not use this to call Windows ANSI functions! Always use wide-char functions on this operating system unless you want to deal with codepages.

Examples

string text = "Hello, world!";
linuxApi(charPtr!text);

Meta