www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - array and pointer

reply takeshi <takeshi enomosphere.net> writes:
Hello, I have just started learning D.

I cannot compile the code in the documentation on array and pointer
either with dmd (D 2.0) and gdmd (D 1.0).

Is some compile option or cast required?

int* p;
int[3] s;
p = s;
Mar 05 2009
next sibling parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
takeshi wrote:
 Hello, I have just started learning D.
 
 I cannot compile the code in the documentation on array and pointer
 either with dmd (D 2.0) and gdmd (D 1.0).
 
 Is some compile option or cast required?
 
 int* p;
 int[3] s;
 p = s;
If that's the example, then it's out of date. It should be this: int* p; int[3] s; p = s.ptr; -- Daniel
Mar 05 2009
parent takeshi <takeshi enomosphere.net> writes:
Hello Daniel,

Thank you. It works.

 If that's the example, then it's out of date.  It should be this:
 
 int* p;
 int[3] s;
 p = s.ptr;
Mar 05 2009
prev sibling next sibling parent Derek Parnell <derek psych.ward> writes:
On Thu, 5 Mar 2009 12:52:14 +0000 (UTC), takeshi wrote:

 Hello, I have just started learning D.
 
 I cannot compile the code in the documentation on array and pointer
 either with dmd (D 2.0) and gdmd (D 1.0).
 
 Is some compile option or cast required?
 
 int* p;
 int[3] s;
 p = s;
Try ... int* p; int[3] s; p = s.ptr; -- Derek Parnell Melbourne, Australia skype: derek.j.parnell
Mar 05 2009
prev sibling parent Stewart Gordon <smjg_1998 yahoo.com> writes:
takeshi wrote:
 Hello, I have just started learning D.
Welcome.
 I cannot compile the code in the documentation on array and pointer
 either with dmd (D 2.0) and gdmd (D 1.0).
<snip> Known error in the docs. http://d.puremagic.com/issues/show_bug.cgi?id=996 Stewart.
Mar 06 2009