www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - D Strings vs C++ Strings

reply "Vathix" <vathixSpamFix dprogramming.com> writes:
In cppstrings.html under "Conversions to C Strings", the D example is
misleading. While the quote "In D, strings can be implicitly converted to
char*" is true, char* isn't necessarily a [null-terminated] C string. It
should use toStringz() IMHO.
Jun 03 2004
parent reply Mike Swieton <mike swieton.net> writes:
On Thu, 03 Jun 2004 21:34:57 -0400, Vathix wrote:

 In cppstrings.html under "Conversions to C Strings", the D example is
 misleading. While the quote "In D, strings can be implicitly converted to
 char*" is true, char* isn't necessarily a [null-terminated] C string. It
 should use toStringz() IMHO.

Agreed. The documentation could be improved. May I suggest that the docs like somewhere to a wiki? I think it'd be great to allow readers to post clarifications and examples, and a wiki would be a good way to do that easily. I like the docs on php.net because they have a message board built into the documentation pages. It would be better than pestering Walter to update the necessarily imperfect documentation. Mike Swieton __ They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance. - Terry Pratchett
Jun 03 2004
parent John Fletcher <J.P.Fletcher aston.ac.uk> writes:
Mike Swieton wrote:

 On Thu, 03 Jun 2004 21:34:57 -0400, Vathix wrote:

 In cppstrings.html under "Conversions to C Strings", the D example is
 misleading. While the quote "In D, strings can be implicitly converted to
 char*" is true, char* isn't necessarily a [null-terminated] C string. It
 should use toStringz() IMHO.

Agreed. The documentation could be improved. May I suggest that the docs like somewhere to a wiki? I think it'd be great to allow readers to post clarifications and examples, and a wiki would be a good way to do that easily.

There is a wiki for D. Its at this location: http://www.prowiki.org/wiki4d/wiki.cgi?FrontPage John
Jun 14 2004