[Issue 24357] New: String spec needs updating
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jan 26 16:07:32 UTC 2024
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 at puremagic.com
Reporter: nick at 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.
--
More information about the Digitalmars-d-bugs
mailing list