string literals

bearophile bearophileHUGS at lycos.com
Fri Jan 25 18:06:32 PST 2008


Saaa:

> If you load a file into a char[][], will the file be stored in the code 
> segment?

Nope.


> But shouldn't there be an way (per variable) to force the compiler to not 
> store it like that?

In practice, there is. In D 1.x string literals are, dynamic ones aren't.


> I know this, although it just says it creates a dynamic array. How do you 
> know that the .dup dynamic array is not read-only.

In D.1.x dyn arrays are mutable.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list