I'm struggling to call mktemp in D:

    import core.sys.posix.stdlib;
    import std.string: toStringz;
    auto name = "alpha";
    auto tmp = mktemp(name.toStringz);

but I can't figure out how to use it so DMD complains:

/home/per/Work/justd/fs.d(1042): Error: function core.sys.posix.stdlib.mktemp (char*) is not callable using argument types (immutable(char)*)

How do I create a mutable zero-terminated C-style string?

I think I've read somewhere that string literals (`const` or `immutable`) are implicitly convertible to zero (null)-terminated strings.

Reply via email to