Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Dimensioning Static Arrays

Part of ArraysCategory

Description

Shows two ways that arrays can be dimensioned.

Example

void main()
{
    /* 
        Believe it or not, but these two arrays        
        have the same dimensions. 
    */

    int[20][2] whatever;
    int whatever2[2][20];

    whatever[0][19] = 2;
    whatever2[0][19] = 2;
}

Source

Inspired by D:22869.