Why not this code not printing 10?
(It is just a binary tree with one node i.e. root. And value of root is 10)
#include <stdio.h>
#include<stdlib.h>
struct BinaryTree *root=NULL;
struct BinaryTree{
int data;
struct BinaryTree *left;
struct BinaryTree *right;
};
struct BinaryTree *node(int data)
{
struct BinaryTree *node;
node=(struct BinaryTree*)malloc(sizeof(struct BinaryTree));
node->data=data;
node->left=node->right=NULL;
return node;
}
struct BinaryTree *insert(int *root,int data1){
if(root==NULL){
root=node(data1);
return root;
}
}
int main() {
insert(root,10);
printf("%d",*root);
return 0;
}