Variable lengh arrays of fixed length arrays

Bruno Medeiros brunodomedeirosATgmail at
Tue Aug 8 13:51:56 PDT 2006

Oskar Linde wrote:
>> If one codes
>>   char[9] X;
>>   X = "abcdefghi";
>> Why on Earth would the compiler think I'm trying to do anything else but
>> copy the data from the literal to the array? I'm mean...what else can 
>> I do?
>> I can't change the 'reference' because there is no reference with fixed
>> length arrays - they just exist as RAM - they are not a pseudo struct 
>> like
>> variable length arrays. 
> Not being able to assign static arrays also means that you can't use 
> them as a return type from functions.

Nor as inout parameters, nor as AA keys...

"I have a dream... that one day the chains of discrimination shall be 
cast away from all specdom. That one day static arrays shall stand 
together with any value type, and look upon each other as equals! And 
that our children will live in a type system where all segregation and 
C-lavery have long been forgotten in the mists of alpha stages."
  - Martin Luther String
..or something like that ;)

Bruno Medeiros - MSc in CS/E student

More information about the Digitalmars-d-learn mailing list