String literal converted to char*. Doc bug?

simendsjo simen.endsjo at pandavre.com
Fri Apr 8 10:15:31 PDT 2011


The documentation for array says
> (...), and a string literal can be implicitly cast to a char*

But this fails
char* a = "a"; // cannot implicitly convert expression "a" of type
string to char*

This works:
char* a = cast(char*)"a";

Is the documentation a bit out of date, is this a bug, or is it only
correct in some cases?


More information about the Digitalmars-d-learn mailing list