implicit casts with dmd ver 1.0
Johan Granberg
lijat.meREM at OVE.gmail.com
Fri Jan 19 07:47:59 PST 2007
Peter Blicharski wrote:
> Hello.
>
> I'm having trouble with the sample code shipped with dmd Ver 1.0
> During compilation i encounter implicit cast errors (file dhry.d)
> By the way, the the dfl window library code is full of these error, too.
> Isn't the dmd compiler supposed to make a cast from char[] to char*
> without error? Or is it needed to always make an explicit cast?
>
> Best regards
>
> Peter Blicharski
The implicit cast from char[] to char* was deprecated shortly before 1.0.
Use this instead but be carefull as there is no guarantee that a is
nullterminated (if it is a slice it wont).
char[] a="asdsdfs";
char* b=a.ptr;
More information about the Digitalmars-d
mailing list