R
Rick
Hi,
Another question for today, it's about structs refering to each other. I
tried this code
struct List;
struct child
{
struct List parent;
};
struct List
{
struct Child children[];
List parent;
};
As you can see, there's cross-referencing. And that's giving problems. In
the first case, the parent field of the Child struct ain't delcared yet so I
tried to put the Parent above in short, simmiliar as with declaring
functions in top of your C unit. But it didn't work.
And their's another problem, the List field inside the List struct won't
work either, gettings this error "Undefined structure 'List'" (using an old
Borland C++). Can this be fixed?
Greetings,
Rick
Another question for today, it's about structs refering to each other. I
tried this code
struct List;
struct child
{
struct List parent;
};
struct List
{
struct Child children[];
List parent;
};
As you can see, there's cross-referencing. And that's giving problems. In
the first case, the parent field of the Child struct ain't delcared yet so I
tried to put the Parent above in short, simmiliar as with declaring
functions in top of your C unit. But it didn't work.
And their's another problem, the List field inside the List struct won't
work either, gettings this error "Undefined structure 'List'" (using an old
Borland C++). Can this be fixed?
Greetings,
Rick