Doubt - Static multidimension arrays

alb via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 19 11:14:30 PST 2016


So guys: Ali, Mike Parker and tsbockman thanks for all your 
explanation, in fact looking now I and after making some tests I 
really got it.

So:
    int[2]    a1; // Array of 2 elements of type int

    int[2][5] a2; // Array of 2 elements of type int divided in 5 
rows

    writeln(a2[0]); // = accessing row 0 = [0,0]
    writeln(a2[4]); // = accessing row 4 = [0,0]

If that in mind, now it all makes sense for me, and of course 
it's consistent as well. Sorry to bother about this, but I think 
this will help other newcomers.

Thanks again for help/tips which helped turn my mindset.

Albert.


More information about the Digitalmars-d-learn mailing list