A debug class has started

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Dec 13 21:10:07 UTC 2021


On Mon, Dec 13, 2021 at 08:47:12PM +0000, forkit via Digitalmars-d-learn wrote:
> On Monday, 13 December 2021 at 20:28:26 UTC, H. S. Teoh wrote:
> > On Mon, Dec 13, 2021 at 08:04:24PM +0000, forkit via Digitalmars-d-learn
> > wrote:
[...]
> > > (this produces an unpredictable result??)
> > > char* w = cast(char*)str.dup;
> > 
> > Shouldn't you be using:
> > 
> > 	char* w = str.dup.ptr;
> > 
> > instead??
[...]
> that also produces the same unpredictable result.
> 
> i.e (an extra character from 'somewhere' appears in the output from
> line below)
> writeln(replaceChar(w, str.length, ';', 'X'));
[...]

That's weird. Can you post the minimal code that exhibits this problem?


T

-- 
Prosperity breeds contempt, and poverty breeds consent. -- Suck.com


More information about the Digitalmars-d-learn mailing list