LLJS
LLJS copied to clipboard
allocating an array of pointers to custom struct types
If I try to compile this code:
struct Foo {
int bar;
int baz;
}
let Foo** arr = new Foo*[100];
I get this error:
main2.ljs:7:7: error: incompatible types: assigning
dyn' to Foo**'
What am I doing wrong?
I believe you need to do:
typedef Foo* FooPointer;
let FooPointer* arr = new FooPointer[100];
Yep, that worked. Is this a real bug? Since a lot of the syntax seems C/C++ inspired, seems like this could be a nice addition.
Yah, it seems to be broken. I'll take a look at it.