const strings (D1.0)

Bill Baxter dnewsgroup at billbaxter.com
Mon Mar 3 01:27:12 PST 2008


Is this correct behavior?

import std.stdio;
import std.string;

const MM_REAL_STR =       "real";
const MM_INT_STR =        "integer";


void main()
{
     writefln(toString(MM_REAL_STR.ptr)); // --> prints "realinteger"
}


I thought all literal strings were supposed to be zero terminated.
That doesn't go for const strings?

--bb


More information about the Digitalmars-d-learn mailing list