我在这行代码的作用下遇到了麻烦:
struct node* node = (struct node*)
在这种情况下使用代码:
typedef struct node node;
struct node* newNode(int key)
{
struct node* node = (struct node*)
malloc(sizeof(struct node));
node->key = key;
node->left = NULL;
node->right = NULL;
node->height = 1; // new node is initially added at leaf
return(node);
}
为什么指针放在标识符之后?