I want to port a look-up table of parameters which is an array of structures in C to C++. I read a few questions and understood that the C-style struct initializer is not allowed in C++. How can this be ported to C++?
typedef struct {
char const *property;
int count;
} TYPE2;
typedef struct {
int Address;
char const *Name;
union
{
TYPE1 foo;
TYPE2 bar;
}u;
} PARAMS;
//Initialize table:
const PARAMS paramTbl[] =
{
{0x1000, "Param 1", {.bar = {"abc",0}}}, //So on ..
.
.
}
Any help appreciated.