noob Q: declaring string variables

BCS none at anon.com
Sat May 29 15:04:07 PDT 2010


Hello Duke,

> char[] password = "sesame";

IIRC you are using D2 and that only work for D1, for D2 I think you need 
to do:

string password = "sesame";

This has something to do with the const system. I do know there is no way 
to safely modify a char[] set from a string literal so D2 forcing you to 
use const (or immutable, I forget what's used) for this case fixes a hole 
in D1.


-- 
... <IXOYE><





More information about the Digitalmars-d-learn mailing list