Thanks, works perfectly.
Solution:
Code:
#include <stdio.h>
#include <stdlib.h>
#define LENGTH(x) (sizeof(x)/sizeof(x[0]))
struct foo {
int a;
char* b;
};
struct foo bar[] = {
{1, "abc"}, {2, "def"}, {3, "ghj"}, {0, NULL}
};
struct foo baz[] = {
{1, "xyz"}, {0, NULL}
};
struct foo* array[] = {
bar, baz
};
int main(void) {
int i, j;
printf("%s\n", array[0][2].b);
printf("%d %d\n", (int)LENGTH(bar), (int)LENGTH(array[0]));
for(i = 0; i < LENGTH(array); i++)
for(j = 0; !(array[i][j].a == 0 && array[i][j].b == NULL); j++)
printf("%d: %s\n", array[i][j].a, array[i][j].b);
return EXIT_SUCCESS;
}