array and pointers

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Thu Jan 25 09:31:19 PST 2007


Matthew Wesley wrote:
> Think of D arrays as:
> 
> struct DArray {
> 	type *ptr;
> 	size_t length;
> }

Nitpick: the members are the other way around :p. (in DMD)
Not that it usually matters, but this may come up when writing inline 
assembly or calling extern(C) functions.
This is not in the spec though, so it's implementation-dependent.
However, it's not likely to change in DMD until Walter finally gets sick 
of printf[1]...


[1]: The current layout allows him to write 'printf("%.*s", string);' to 
print D strings.


More information about the Digitalmars-d-learn mailing list