On Friday, 22 January 2016 at 08:39:06 UTC, Dibyendu Majumdar
wrote:
On Friday, 22 January 2016 at 01:53:53 UTC, Chris Wright wrote:
On Thu, 21 Jan 2016 21:52:06 +, Dibyendu Majumdar wrote:
Hi
I have C code where the struct has a trailing array member:
struct matrix {
int rows;
On Friday, 22 January 2016 at 01:53:53 UTC, Chris Wright wrote:
On Thu, 21 Jan 2016 21:52:06 +, Dibyendu Majumdar wrote:
Hi
I have C code where the struct has a trailing array member:
struct matrix {
int rows;
int cols;
double data[1];
};
D has bounds checking, which makes this
Hi
I have C code where the struct has a trailing array member:
struct matrix {
int rows;
int cols;
double data[1];
};
In C code this is allocated dynamically to be variable size. The
array is used just as normal.
How should this be translated to D? Will D's array access allow
data
Dibyendu Majumdar:
On Thursday, 21 January 2016 at 21:52:06 UTC, Dibyendu Majumdar
wrote:
How should this be translated to D? Will D's array access allow
data elements to be accessed beyond the size declared?
Take a look at the code I've written here:
On Thu, 21 Jan 2016 21:52:06 +, Dibyendu Majumdar wrote:
> Hi
>
> I have C code where the struct has a trailing array member:
>
> struct matrix {
>int rows;
>int cols;
>double data[1];
> };
>
> In C code this is allocated dynamically to be variable size. The array
> is used