假设这个方案:的typedef不妨碍关键字struct一个struct
/* avl.c */
typedef struct avl {
void *data;
int height;
struct avl *left, *right;
} node;
/* avl.h */
struct avl; /* opaque */
我想用:
struct node *root;
,而不是
node *root;
在avl.c
,但对于现在我发现的最好的是:
struct avl {
void *data;
int height;
struct avl *left, *right;
};
#define node avl
另一种方式?
你试图解决什么(更高水平)的问题? – pmg