i have two headers
in header “BinTree.h”:
typedef struct node {
ElemType data;
struct node *lchild;
struct node *rchild;
}BTNode;
in header “Queue.h”(which includes BinTree.h):
typedef BTNode* Dataype;
at compiling the compilor said:
error: ‘BTNode’ does not name a type
What’s wrong?
Did you include
BinTree.hinQueue.hbefore the declaration?Or have you
.cpp(or moral equivalent) include it beforehandEDIT FOR CDT
Forward declarations are the answer.
As you did not post the code it is difficult to tell.
But I would hazzard a guess here
whould hit the ticket in
Queue.h