I'm trying to invoke a C function that takes a pointer to a C string:
void glShaderSource( GLuint shader,
GLsizei count,
const GLchar **string,
const GLint *length);
I'm having trouble to cast a []const u8 to the string pointer. Some time ago I asked a similar question here, about how to pass a string literal, and the trick was to cast it like this:
&[_][*c]const u8{string_literal}
But if I try the same thing I get this error:
error: expected type '[*c]const u8', found '[]u8'
I tried the obvious thing (to me), which was a pointer to the contents of the slice:
&slice.ptr
That made the compiler happy, but passed garbage to the function, so I must be misunderstanding something...
What's the right way to do this?