On 05/09/2013 07:43 PM, Steven Schveighoffer wrote:

> On Thu, 09 May 2013 22:14:41 -0400, Ali Çehreli <acehr...@yahoo.com> wrote:

>> Then, each of those strings point at 22 bytes of individully allocated
>> memory areas.
>
> No, each array points at static data.  Strings are immutables stored in
> the data segment.

You are right. They start at pointing to the same string but as soon as each string is used in a special way, say each gets appended a char, then they own their special characters:

            s = "aaaaaaaaaaaaaaaaaaaaa";

            // Some time later:
            s ~= 'x';

Now each s.ptr is different.

Ali

Reply via email to