On Friday, 19 December 2014 at 14:41:07 UTC, Anonymous wrote:
What a big surprise. If you make an array of struct, each item of your array has the length of the struct. structs a values. If you want to append a struct to an array just append a pointer to the struct:

----------
struct arg{uint a,r,g,h;};

arg * [] argh;
arg [] argv;

foreach(immutable i; 0..1000)
  argh ~= new arg;
----------

so in argh, each item is a size_t pointer. damn.
In argv, the delta between each item is (a.sizeof+r.sizeof+g.sizeof+h.sizeof)
In argh, the delta between each item is (arg *).sizeof

The two versions which zeljkog compared both deal with values,
not pointers. You're barking up the wrong tree.

Reply via email to