I have this struct:
struct Foo {
int a;
int* b;
};
Then I'm creating an instance for it like this:
int x [] = { 5, 6 };
Foo y = { 2, x };
But, I'd like to create the x
array inline, maybe something like this:
struct Foo y = { 2, (int[]) { 5, 6 } };
But the example above do not work... How can I achieve this?
--------- EDIT:
I'm getting this error from intellisense:
cast to incomplete array type "int []" is not allowed
Build error:
Error C4576 a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax
I'm using Visual Studio 2015 (v140).