Problem with D calling C.

bearophile bearophileHUGS at
Mon Jan 3 12:25:48 PST 2011

Bob Cowdery:

I don't know what your bug is, but this is bad D code:
>     r = lib_speex_encode(cast(short*)smpls, cast(char*)bytes);

Use the "ptr" field of D arrays:
r = lib_speex_encode(smpls.ptr, bytes.ptr);


More information about the Digitalmars-d-learn mailing list