Using OpenGL (custom port)

Moritz Warning moritzwarning at web.de
Sun Oct 4 17:18:58 PDT 2009


On Sun, 04 Oct 2009 19:52:12 -0400, David Butler wrote:

[..]
> Is there a difference between a pointer to a D array and an int* in C?
> How do I convert between the two?  Am I even looking in the right place?
> 

You can think of a D array as a struct of a length value and a C pointer.

struct Array
{
  size_t length;
  void* ptr;
} 

Use
someOpenGLFunction(array.ptr)
instead of
someOpenGLFunction(&array)

Please also keep in mind that only array literals are \0 terminated.


More information about the Digitalmars-d-learn mailing list