On 13.12.2021 13:49, forkit wrote:
On Monday, 13 December 2021 at 09:49:05 UTC, forkit wrote:
....
char* w = cast(char*)str.toStringz; // this seems to be the solution
class has ended ;-)
That's because `str` is initialized by a literal and you can not change
it by definition. When you call `toStringz` it duplicates that literal
(adding terminating zero at the end) and the duplicate is mutable. I
would recommend do not use `toStringz` and just make duplicate of the
literal - https://run.dlang.io/is/vaosW0