just a few small questions

Bruno Medeiros brunodomedeirosATgmail at SPAM.com
Sat Apr 15 11:28:45 PDT 2006


Derek Parnell wrote:
> 
> One major difference from C arrays is that the indexes are *used* in the 
> reverse order from C. Meaning that in C one would write ...
> 
>    item = a[X][Y];
> 
> but in D one writes ...
> 
>    item = a[Y][X];
> 
> --Derek Parnell
> Melbourne, Australia

This is not correct, I belive (or at leas mis-explained) . Only D array 
declaration and C array declaration have a different order. The array 
*usage*, or rather, the indexing of an array works the same. That is, in 
both C and D:
   //The X element is accessed first, and then the Y element is accessed
   item = a[X][Y];


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



More information about the Digitalmars-d-learn mailing list