On Monday, 23 January 2017 at 06:42:00 UTC, Suliman wrote:
You have *two* distinct strings here.

Yes, I understand, I am trying to find out how it's work on low level. Any ideas why zero is used?

string *literals* in d are nul terminated to ease interoperation with C

so
string s = "foo";
writefln("%d",cast(ubyte)s.ptr[3]); // use '.ptr' to skip bounds check

prints 0u

Reply via email to