two-dimensional C array and its analog in D

bearophile bearophileHUGS at lycos.com
Wed Aug 8 01:50:51 PDT 2012


Alexandr Druzhinin:

> 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)

That C code doesn't look correct, because the given data contains
no pointers.

Why don't you show us a complete compilable runnable correct tiny
C program, that we have to translate to D?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list