dmedia.dprogramming.com - two new tutorials

Tom S h3r3tic at remove.mat.uni.torun.pl
Sun May 7 15:28:42 PDT 2006


Hasan Aljudy wrote:
> Nice! I just started reading, and noticed you're using toStringz for 
> strings.
> I've tried using SDL with D before, and I noticed that you don't need to 
> use toStringz at all, for example, this works just fine:
> 
> SDL_WM_SetCaption("My SDL Window", null);
> 
> at least it worked when I tried it.

Please, please, please read the whole thing before you write comments 
like this one :S
Quote from my article:

`But then if you know the D specification inside-out, you might say 
“Hey, but when the compiler allocates space for string literals, it 
inserts an additional zero just after that memory range !”. Calm down, 
please, you can remove the toStringz function call and its associated 
import if you know what you're doing. But if someone wanted to have a 
window with some dynamically - generated caption, they would be in some 
serious trouble.`


-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d-pu s+: a-->----- C+++$>++++ UL P+ L+ E--- W++ N++ o? K? w++ !O 
!M V? PS- PE- Y PGP t 5 X? R tv-- b DI- D+ G e>+++ h>++ !r !y
------END GEEK CODE BLOCK------

Tomasz Stachowiak  /+ a.k.a. h3r3tic +/



More information about the Digitalmars-d-learn mailing list