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
On Monday, 27 January 2014 at 09:06:17 UTC, Colin Grogan wrote:
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
On Monday, 27 January 2014 at 09:34:04 UTC, Namespace wrote:
On Monday, 27 January 2014 at 09:06:17 UTC, Colin Grogan wrote:
Why wont the following code compile?
import std.stdio;
void main()
{
myStruct[] mystructs = {
{1, 1.1f},
{2, 2.2f}
};
}
extern(C){
struct
On Monday, 27 January 2014 at 10:13:08 UTC, Colin Grogan wrote:
Arrays are enclosed in [] ;)
I'm an idiot.
Can I delete this thread to save further embarrassment? :)
No! Evenryone will see this! :E~
On Monday, 27 January 2014 at 10:13:08 UTC, Colin Grogan wrote:
On Monday, 27 January 2014 at 09:34:04 UTC, Namespace wrote:
Arrays are enclosed in [] ;)
I'm an idiot.
Can I delete this thread to save further embarrassment? :)
HA-HA!
(read it with Nelson voice, ofc)
On Monday, 27 January 2014 at 13:08:28 UTC, Colin Grogan wrote:
In my defense, I believe C initializes arrays with the curly
brackets
Can I keep making excuses?
Yes you can... And don't worry, I mess up initialization too.
Lots of time.
Especially when I tried initializing an array of