two-dimensional C array and its analog in D

BLM768 blm768 at gmail.com
Wed Aug 8 08:04:11 PDT 2012


> I mean that I call C function from D code. And C function takes 
> void** pointer as its argument. In C this means array of array, 
> but if I pass D two-dimensional array it doesn't work (but 
> compiles).

I'm pretty sure that the issue is D's internal implementation of 
2-dimensional arrays. From what I remember, if the arrays are 
defined as fixed-size, D creates just a single block of array 
data rather than creating pointers to pointers. OpenGL is 
expecting an array of pointers to 1-dimensional arrays, but D is 
giving it the pointer to the actual indices.


More information about the Digitalmars-d-learn mailing list