static-arrays

static arrays defined with unspecified size, empty brackets?

For the C++ code fragment below: class Foo { int a[]; // no error }; int a[]; // error: storage size of 'a' isn't known void bar() { int a[]; // error: storage size of 'a' isn't known } why isn't the member variable causing an error too? and what is the meaning of this member variable? I'm using gcc version 3.4.5 (mingw...

C# - convert C++ array of struct w/o tons of new calls?

C++ typedef struct someStruct { int val1, val2; double val3; } someStruct; someStruct a [1000] = { {0, 0, 0.0}, {1, 1, 1.0}, ... }; The only way to initialize such a table in C# I know of is to write something like class SomeStruct { int val1, val2; double val3; public SomeStruct (int val1, int val2, double val3) ...