On Friday, 4 May 2018 at 13:02:08 UTC, NewUser wrote:
tried defining items[] as both "Item[] items" and "Item* items" in d, it compiles okay but gives an error when trying to access it.

You were on the right track. D array notation is:

<type>[] <identifier>;

For me this works:

```
struct Item
{
  int id;
};

struct Group
{
  int i;
  int item_count;
  Item[] items;
};

void main()
{
    auto g = Group();
    g.items ~= Item(3);
    assert(g.items[0].id == 3);
}
```

Reply via email to