I am attempting to create a const structure in C but can't seem to figure it out.
typedef struct sA{
char* fname;
char* lname;
} A;
To use as an Array:
A list[] = {{"david","smith"},{"john","smith"}};
However, if I have use a second struct:
typedef struct sB{
A inList[];
} B;
I want to define a const structure as:
B newList[] = {
{
{"david","smith"}
},
{
{"john","doe"}
{"joe","doe"}
}
};
len(newList[0].inList)
is different from len(newList[1].inList)
. This can be built dynamically, but how would you build this into a const variable in C?