As Richard said it is not possible to make what you want with incomplete types and variable lenght arrays, but ...
If you don't dislike the dark side of the C, there is a workaround:
typedef struct _TreeNode{
int id;
char* text;
struct _TreeNode* children[1]; } TreeNode;
static TreeNode tree1 = {1, "child", {0}};
static TreeNode tree2 = {2, "secondChild", {0}};
static TreeNode tree3 = {3, "thirdChild", {0}};
static TreeNode tree4 = {4, "fourthchild", {0}};
void *FakeTree[] = {
(void *)0,
(void *)"hidden",
(void *)&tree1,
(void *)&tree2,
(void *)&tree3,
(void *)&tree4
};
void DoSth(void)
{
TreeNode *tree = (TreeNode *)&FakeTree;
for (int i=0; i<4; i++)
{
printf("id=%x, name=\"%s\"\n", pTree->children[i]->id, pTree->children[i]->text);
}
}
The only limit is that it is
mandatory that the integers and the pointers of the machine where you'll use the code have the same size.
Last advice: this could be dangerous for your code, don't make it at home! Jocking, this is how you don't have to make programs, but if it is necessary...
I hope this solves your problem ;)