#include<iostream>
#include<stdlib.h>
#define MaxSize 50
typedef int ElemType;
typedef struct Node *Position;
typedef Position BTNode;
struct Node
{
ElemType data;
struct node *lchild;
struct node *rchild;
}b;
void CreateBTree(BTNode * &b, char*str)
{
BTNode *St[MaxSize], *p;
int top = -1, k, j = 0;
char ch;
b = NULL;
ch = str[j];
while (ch != '\0')
{
switch (ch)
{
case '(':top++; St[top] = p; k = 1; break;
case')':top--; break;
case',':k = 2; break;
default:p = (BTNode *)malloc(sizeof(BTNode));
p->data = ch;
p->lchild = p->rchild = NULL;
if (b == NULL)
b = p;
else
{
switch (k)
{
case 1:St[top]->lchild = p; break;
case 2:St[top]->rchild = p; break;
}
}
}
j++;
ch = str[j];
}
}
其中p St b报错“表达式必须包含指向类的指针类型”
请问大佬们这是为什么呀?