The following code compiles on a C++ compiler.
#include
int main()
{
struct xx
{
int x;
struct yy
{
Based on my brief research and the error message posted by Otto, it appears that C doesn't allow structures to be general-purpose namespace containers like C++ classes and structures are (naturally, because C doesn't even support classes). So you can't nest structure definitions in C. You would have to declare the inner structure outside of the outer structure declaration like this:
struct yy
{
char s;
struct xx *p;
};
struct xx
{
int x;
struct yy *q;
};
I see that the structures cross-reference each other. So if this is even possible in C, you may have to pre-declare the later structure with a line like:
struct xx;
(above both other declarations).