Associative Array - where's my error?

Jesse Phillips jessekphillips+D at gmail.com
Thu Apr 28 07:44:33 PDT 2011


bearophile Wrote:

> Jesse Phillips:
> 
> > I think this just hides the issue. To fix the issue you would need byLine to return a string, since user code my still save and modify the returned value and store it in an AA.
> 
> I don't agree. If you perform a cast of the dup-ed char array to a string you will not have problems. The main problem is the missed duplication (and the bad usage of casts in general, for people coming from C/C++).
> 
> Bye,
> bearophile

_This_ code wouldn't not have problems, that doesn't mean code won't be written that does have problems.


More information about the Digitalmars-d-learn mailing list