On Friday, 4 May 2018 at 15:37:28 UTC, ag0aep6g wrote:
On Friday, 4 May 2018 at 13:02:08 UTC, NewUser wrote:
How can I use the following c structure from d.
struct Item
{
int id;
};
struct Group
{
int i;
int item_count;
struct Item items[];
};
tried defining items[] as both "Item[]
On Friday, 4 May 2018 at 13:02:08 UTC, NewUser wrote:
How can I use the following c structure from d.
struct Item
{
int id;
};
struct Group
{
int i;
int item_count;
struct Item items[];
};
tried defining items[] as both "Item[] items" and "Item* items"
in d, it compiles okay but
On Friday, 4 May 2018 at 14:55:18 UTC, Timoses wrote:
On Friday, 4 May 2018 at 13:27:03 UTC, NewUser wrote:
Hi Timoses,
The structure is being returned from c and I'd like use it
from d.
What you have work perfectly when assigning from d.
Regards,
NewUser
Then you probably need some
On Friday, 4 May 2018 at 13:27:03 UTC, NewUser wrote:
Hi Timoses,
The structure is being returned from c and I'd like use it from
d.
What you have work perfectly when assigning from d.
Regards,
NewUser
Then you probably need some `extern(C)` statement introducing the
C function and the
On Friday, 4 May 2018 at 13:21:53 UTC, Timoses wrote:
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:
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:
[] ;
For me this works:
```
struct Item
{
int id;
};
On Friday, 4 May 2018 at 13:02:08 UTC, NewUser wrote:
How can I use the following c structure from d.
struct Item
{
int id;
};
struct Group
{
int i;
int item_count;
struct Item items[];
};
tried defining items[] as both "Item[] items" and "Item* items"
in d, it compiles okay but
Hi,
How can I use the following c structure from d.
struct Item
{
int id;
};
struct Group
{
int i;
int item_count;
struct Item items[];
};
tried defining items[] as both "Item[] items" and "Item* items"
in d, it compiles okay but gives an error when trying to access
it.
Here is