shd <[email protected]> wrote:
Hello, I'm having a problem in passing a value to char* expecting function in D 2.0.
Why does the function expect a char*? If it is an external C function, and it might change the passed values, you should make a duplicate mutable string, or use char[] in lieu of string. If it is an external C function that will *not* change the passed values, and you have write access to the D headers to interface to C, use const char* instead. If no write access, I would use cast(char*)myString.ptr. If it is a D function, why does it not use const? Or for that matter, why does it not use char[]? -- Simen
