I used to not even notice that if D declare an array in C-style, and then indexing it will also in C-style :) Actually, I have a small question. And what is the advantage of indexing arrays D-style in front of a C-style arrays? Because C-style indexing is much more familiar: first, we point line, and then the columns.

import std.algorithm;

void main() {

    int cArr[2][4];
    assert(equal(cArr[], [[0, 0, 0, 0],
                          [0, 0, 0, 0]]));

    int[2][4] dArr;
    assert(equal(dArr[], [[0, 0],
                          [0, 0],
                          [0, 0],
                          [0, 0]]));
}

Reply via email to