SDL and GC

lanael no at mail.never
Mon Apr 10 08:55:25 PDT 2006


> Don't forget that character literals are allocated with an implicit \0 at 
> their ends, so this code:
>
> sample = Mix_LoadWAV_RW(SDL_RWFromFile("sound.wav", "rb"), 1);
>
> will be perfectly fine :)

yep; but I usually don't hardcode filenames ! :)


> Moreover, references and pointers are initialized to null in D, so you don't 
> have to write 'Mix_Chunk* sample = null;", simply stating "Mix_Chunk* 
> sample;" will be enough.

right. I wrote this a long time ago; when I wasn't sure about the D 
behavior !  You never know ! :)

Anyway, great explanation about the static stuffs. ( which I don't use 
at all : I don't know how to use them )





More information about the Digitalmars-d-learn mailing list