Change the printf statement to :
printf("&root->%x--root-->%x--&(root->data)=%x--&(root->left)=%x--&(root-->right)=%x--*root-->%d",&root,root,&(root->data),&(root->left),&(root->right),*root);Actually printf behaves unexpectedly when we use %d before %x in the same printf statement. root and &(root->data) will give the same address because both of them point to the same memory location. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
