passing 0 to const char[]

cal callumenator at gmail.com
Tue Aug 14 13:14:14 PDT 2012


> How about cast(const(char[]))([0]) ?

Although I think what you actually want is probably just null, 
since a C function expecting an array is expecting a pointer, and 
passing cast(const(char[]))([0]) satisfies the signature but 
gives you a non-null array. I would guess what you really want to 
alias PETSC_NULL to null and pass that...


More information about the Digitalmars-d-learn mailing list