Re: array questions

2009-01-12 Thread yes
thank you I think I understand how it works

Re: array questions

2009-01-11 Thread bearophile
yes: > is it possible to make a dynamic array less dynamic? > int[][] array; > array[0].length = 10; //has to be set at runtime > writefln(array[1].length); // writes also 10 > Because I now have to loop through the whole array to check for correct size. If you are using normal D dynamic arrays y

Re: array questions

2009-01-11 Thread Daniel Keep
yes wrote: [snip] also, can this be done? int size; size = 10; //runtime void function( int[size][] array){} No, static arrays are static, i.e. compile time. I meant it to be an dynamic array argument, but that the function wouldn't need to check the size of all the elements itself. Dynam

Re: array questions

2009-01-11 Thread yes
> > > Hello again > > > > is it possible to make a dynamic array less dynamic? > > > > int[][] array; > > > > array[0].length = 10; //has to be set at runtime > > Um, if that's your code, everything should crash at this point (or throw > in debug mode): array is null, that is, empty, so there

Re: array questions

2009-01-11 Thread Sergey Gromov
Sun, 11 Jan 2009 17:17:54 -0500, yes wrote: > Hello again > > is it possible to make a dynamic array less dynamic? > > int[][] array; > > array[0].length = 10; //has to be set at runtime Um, if that's your code, everything should crash at this point (or throw in debug mode): array is null, tha