请高手指点迷津....谢谢!!
程序代码:
typedef struct node{ elem_type data; struct node *lchild; struct node *rchild; }tree_node,*tree_ptr; int init_node(tree_ptr *pnode) { pnode = (tree_ptr)malloc(sizeof(tree_node)); if(pnode == NULL){ printf("fail: malloc failed\n"); exit(0); } pnode->lchild = pnode->rchild = NULL; pnode->data = 0; return 0; }上面pnode = (tree_ptr)malloc(sizeof(tree_node));
pnode->lchild = pnode->rchild = NULL;
pnode->data = 0;
这三条语句有错么??望高手指点.....谢谢!