Error when using `import`.
Danilo
codedan at aol.com
Wed Feb 28 10:53:49 UTC 2024
On Wednesday, 28 February 2024 at 07:56:16 UTC, Liam McGillivray
wrote:
>
> ```
> DrawText("Open Emblem", 180, 300, 64, Colors.RAYWHITE);
> ```
>
> So why is it that one of these functions, but not the other is
> allowing D strings in place of C-style strings?
C is expecting null-terminated chars. D string type is not
null-terminated,
but using directly a string literal like „Open Emblem“ is
null-terminated.
In D you use mystring.toStringz to create a null-terminated C
char-array.
Example for LoadTexture:
https://github.com/D-a-n-i-l-o/raylib-d_examples/blob/main/examples/textures/047_textures_logo_raylib/source/app.d
More information about the Digitalmars-d-learn
mailing list