Problems with string literals and etc.c.odbc.sql functions

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Dec 18 14:18:34 PST 2015


On Friday, 18 December 2015 at 22:14:04 UTC, Fer22f wrote:
> When I remove the string literal and replace it with null, it 
> compiles. .ptr and .toStringz both give immutable char* 
> references, and don't work. A "cast(char *)"DNS=*maydns*;"" 
> works, but it feels a lot like a hack that will not work in the 
> long run.

That's what the examples on MSDN do too though, a cast. At first 
I thought the binding was missing a const, but the ODBC docs 
don't specify it as const either and cast.

So it is kinda weird but I think right according to docs. 
However, I'd argue we should make it const if it can be...


More information about the Digitalmars-d-learn mailing list