Looking at some .h script I saw this:
struct
{
int resource;
} SimulRes[SIMULRES];
Where SIMULRES is define above as:
#define SIMULRES 50
I assume this is an anonymous struct but I am used to seeing it defined inside a named struct instead. How does this behave with different c++ compilers? What does parameter inside square brackets do? Thanks.
This is not C++ syntax, but a C syntax.
It merely means defining an array
SimulRes
, of 50 (SIMULRES
) elements, where type of the elements is a struct having a single itemresource
.