www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24357] New: String spec needs updating

https://issues.dlang.org/show_bug.cgi?id=24357

          Issue ID: 24357
           Summary: String spec needs updating
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dlang.org
          Assignee: nobody puremagic.com
          Reporter: nick geany.org

This section needs a general clean up, fixing typos and more links:
https://dlang.org/spec/arrays.html#strings

 char[] strings are in UTF-8 format. wchar[] strings are in UTF-16 format.
dchar[] strings are in UTF-32 format. 
The above is a bit confusing as strings always have immutable elements.
 Since strings, however, are not 0 terminated in D
This should be moved to the zero-terminated literals section. char* p = &str[3]; // pointer to 4th element char* p = str; // pointer to 1st element The second declaration no longer compiles. PR incoming. --
Jan 26