On 08/07/2012 11:07 PM, Alexandr Druzhinin wrote:
> Hello,
> there is the following C function:
>
> void foo(const void** data);
>
> in C I can do:
>
> int data[N][M];
>
> data[0][0] = ..;
> data[0][1] = ..;
> data[1][0] = ..;
> data[1][1] = ..;
>
> foo(data); // for C code it works and in D code it doesn't (compile, but
> do nothing)

This seems to work:

import std.stdio;

void main()
{
    enum M = 3;
    enum N = 4;

    int[M][N] data;
    data[0][0] = 42;
    writeln(data);
}

The output:

[[42, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]

Ali

Reply via email to