问题描述
error C2664: ‘CreateBiTree’ : cannot convert parameter 1 from 'struct BiTnode ** ’ to 'struct BiTNode ** ’
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
代码
// 实验三.cpp : Defines the entry point for the console application.
//
#include<stdafx.h>
#include"stdio.h"
#include"stdlib.h"
typedef char TElemType;
typedef struct BiTNode
{
TElemType data;
struct BiTnode *lchild,*rchild;
}BiTNode,*BiTree;
void CreateBiTree(BiTree *T)
{
TElemType ch;
scanf("%c",&ch);
if(ch==' ')
*T=NULL;
else
{
*T=(BiTree)malloc(sizeof(BiTNode));
if(!*T)
exit(-1);
(*T)->data=ch;
CreateBiTree(&(*T)->lchild);
CreateBiTree(&(*T)->rchild);
}
}
void