Why wont the following code compile? import std.stdio;
void main()
{
myStruct[] mystructs = {
{1, 1.1f},
{2, 2.2f}
};
}
extern(C){
struct myStruct{
int x;
float y;
}
}
It fails with the (unhelpful imo) error message:
source/app.d(7): Error: a struct is not a valid initializer for a
myStruct[]
The reason I need a C struct is because I'm interfacing to a C library that expects an array of myStructs.
