構造体の入れ子 [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 ;
* 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 ;
2009-04-29 11:15
nice!(0)