Bug 5820 – Documentation states string literals can implicitly convert to char*

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-04-08T10:30:00Z
Last change time
2012-01-20T20:43:25Z
Assigned to
nobody
Creator
simendsjo

Comments

Comment #0 by simendsjo — 2011-04-08T10:30:54Z
http://digitalmars.com/d/2.0/arrays.html says (...), and a string literal can be implicitly cast to a char* char* a = "a"; // cannot implicitly convert expression "a" of type string to char* char* b = cast(char*)"a"; // ok const(char)* c = "a"; // ok
Comment #1 by github-bugzilla — 2012-01-20T20:41:14Z