string literals

Saaa empty at needmail.com
Thu Jan 24 11:30:25 PST 2008


I'm sorry about the late reply..

I read it, but still don't really know what you mean additional literal 
constructor.

But what I really meant was this:
String literals are immutable (read only).

Why is this? (I expect there to be a nice reason for it, I just down't know 
it :)


>> I meant why are they read only?
>>
>>> I don't understand what you mean with "special case". Character arrays
>>> (a.k.a. strings) are arrays just like the rest of 'em :)
>>>
>>> The only difference is that they have an additional literal constructor 
>>> in
>>> the form of "foo".
>> Where can I read about this?
>>
>
> http://digitalmars.com/d/1.0/arrays.html#strings
>
> --downs 




More information about the Digitalmars-d-learn mailing list