SSブログ

構造体の入れ子 [Computing]

/*
* this pair won't work -- error: parse error before "B"
typedef struct A_tag{
B * bb;
int i;
}A;
typedef struct B_tag{
A* bb;
int i;
}B;
*/

// This works fine!
struct A_tag{
struct B * bb;
int i;
}A;
struct B_tag{
struct A * bb;
int i;
}B;
typedef struct A AA;
typedef struct B BB ;
nice!(0) 

nice! 0