Why I (Still) Won't Use D

Walter Bright newshound1 at digitalmars.com
Fri Mar 28 11:30:25 PDT 2008


Michel Fortin wrote:
> std::string is null terminated in its memory representation; that's why 
> you can call s.c_str() and have a char * that lives as long as you don't 
> cause the string to reallocate. So basically, std::string can be freely 
> converted to a C string if you need one. With std::vector and others you 
> don't have that.

That's easy to accomplish with a vector implementation - just append a 0.



More information about the Digitalmars-d mailing list