the output
why it's not in loop 🤔
change the print function to this for starters. also, int main(void) and int main(int argc, char *argv[]) are both valid syntaces(syntaxes?). correct the indentation. don't use typedef for struct mynode_tag. if you want to use typedef, use it for pointer to struct mynode_tag. void print_nodes(mynode *root) { if(root == NULL) return; print_nodes(root->left); printf("data=%d\n",root->data); print_nodes(root->right); }
don't exit(1) without cleaning up :/. just because you couldn't insert one node doesn't mean the program needs to shut down.
Обсуждают сегодня