On Wed, May 13, 2009 at 2:28 PM, Doctor J <nob...@nowhere.com> wrote: > Taken straight from http://www.digitalmars.com/d/1.0/arrays.html, this > doesn't compile: > > void main() > { > string str = "abc"; > char* p = str; // pointer to 1st element > } > > "Error: cannot implicitly convert expression (str) of type char[] to char*" > > I agree it shouldn't compile; I guess I'm asking why the docs say it does.
Once upon a time, it used to. But the implicit conversion from T[] to T* was removed when it was deemed to be too easy to make mistakes using it.