extern "C" {
typedef struct Pair_s {
char *first;
char *second;
} Pair;
typedef struct PairOfPairs_s {
Pair *first;
Pair *second;
} PairOfPairs;
}
Pair pairs[] = {
{"foo", "bar"}, //this is fine
{"bar", "baz"}
};
PairOfPairs pops[] = {
{{"foo", "bar"}, {"bar", "baz"}}, //How can i create an equivalent of this NEATLY
{&pairs[0], &pairs[1]} //this is not considered neat (imagine trying to read a list of 30 of these)
};
如何实现上述样式声明语义?