http://d.puremagic.com/issues/show_bug.cgi?id=6305

           Summary: String literals doesn't already have a 0 appended to
                    them
           Product: D
           Version: D1
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: verylonglogin....@gmail.com


--- Comment #0 from Denis <verylonglogin....@gmail.com> 2011-07-13 01:57:25 PDT 
---
According to http://www.digitalmars.com/d/1.0/arrays.html#printf
"String literals already have a 0 appended to them"
But if we create static arrays, they are exactly one after another: 

import std.stdio;
const s1 = "abcd", s2 = "EFG", s3 = "h";
void main() {
    writefln("%s %s %s\n%s %s %s",
        s1, *(s1.ptr + s1.length), cast(int) *(s1.ptr + s1.length),
        s2, *(s2.ptr + s2.length), cast(int) *(s2.ptr + s2.length)
    );
}

Prints:
abcd E 69
EFG h 104

If I missed something, I think this "something" should be mentioned in
documentation near citation above.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to