假設這個方案:的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