malloc returns a void * which means that when you use malloc, you will need to cast the return value to the type of pointer you want.
Change the above line to:*treePtr = malloc(sizeof(TreeNode));
*treePtr = (treNode *)malloc(sizeof(TreeNode));
malloc returns a void * which means that when you use malloc, you will need to cast the return value to the type of pointer you want.
Change the above line to:*treePtr = malloc(sizeof(TreeNode));
*treePtr = (treNode *)malloc(sizeof(TreeNode));