A debug class has started

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Dec 13 20:28:26 UTC 2021


On Mon, Dec 13, 2021 at 08:04:24PM +0000, forkit via Digitalmars-d-learn wrote:
> On Monday, 13 December 2021 at 12:06:53 UTC, WebFreak001 wrote:
> > 
> > You should really use `.dup` if you want to mutate your string. (You
> > would need to duplicate anyway if you don't want an unsafe cast)
> 
> (this produces an unpredictable result??)
> char* w = cast(char*)str.dup;

Shouldn't you be using:

	char* w = str.dup.ptr;

instead??


T

-- 
It is impossible to make anything foolproof because fools are so ingenious. -- Sammy


More information about the Digitalmars-d-learn mailing list