ERROR - "cannot implicitly convert expression (s) of type int[3u] to int*"
Justin.SpahrSummers at gmail.com
Fri Jun 18 08:41:17 PDT 2010
On Fri, 18 Jun 2010 01:25:32 -0400, Chick Corea <chick.zcorea at gmail.com>
> Those are the result of code that I pulled directly from the D v1 docs from
> Specifically, the code is this.
> int* p;
> int s;
> int a;
> p = s;
> p = a;
I can't speak as to why the D2 code doesn't work, but this example in
the documentation is flat out wrong. To assign a D array to a pointer,
you must use the .ptr property, so that the correct code is actually:
p = s.ptr;
p = a.ptr;
Hope this clears things up.
More information about the Digitalmars-d-learn