Example error for initializer?

Bruno Medeiros brunodomedeirosATgmail at SPAM.com
Thu Jun 22 13:32:49 PDT 2006


Tom S wrote:
> Paolo Invernizzi wrote:
>> Hi all,
>>
>> In http://www.digitalmars.com/d/arrays.html under Pointer Arithmetic 
>> there's:
>>
>> int[] def = [ 1, 2, 3 ];    // dynamic array of 3 ints
>>
>> but does not compile (dmd .0161):
>>
>>   variable xdelta.main.def is not a static and cannot have static 
>> initializer
> 
> Currently only static arrays can have static initializers, so if you 

And by static arrays he means static-storage arrays, and not 
static-length arrays. (The term static is ambiguous for arrays. The 
alternatives for those two are respectively, local-storage, dynamic-length)


-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d-learn mailing list