有没有一种方法可以确定下列查找表中的message
元素的数量,还是我需要在结构中明确指定int size
?找出查找表的大小C
typedef struct {
int enable;
char* message[3];
} lookuptable;
lookuptable table[] = {
{1, {"Foo", "Bar", "Baz"}}, // # 3
{1, {"Foo", "Bar"}}, // # 2
{1, {"Foo"}}, // # 1
{1, {"Foo", "Baz"}}, // # 2
};
很高兴知道。谢谢(你的)信息! –