Btree.h file
#include "Type_Btree.h"
extern Btree Create_Btree();
extern int isEmpty_Btree(Btree B);
extern Btree Construct(element e, Btree L, Btree R);
extern int Root(Btree B, element *e);
extern int Right(Btree B, Btree *R);
extern int Left(Btree B, Btree *L);
the type file Type_Btree.h file
typedef int element;
typedef struct node{
element data;
struct node *left, *right;
}*Btree;
here are some functions concerning Binary trees Btree.c file
#include "Btree.h"
Btree Create_Btree(){
return NULL;
}
int isEmpty_Btree(Btree B){
return (B == NULL);
}
Btree Construct(element e, Btree L, Btree R){
Btree temp;
temp = (Btree) malloc(sizeof(struct node));
if(!temp) return 0;
temp -> data = 0;
temp -> left = L;
temp -> right = R;
return temp;
}
int Root(Btree B, element *e){
if(isEmpty_Btree(B)) return 0;
*e = B->data;
return 1;
}
int Right(Btree B, Btree *R){
if(isEmpty_Btree(B)) return 0;
*R = B->Right;
return 1;
}
int Left(Btree B, Btree *L){
if(isEmpty_Btree(B)) return 0;
*L = B->Left;
return 1;
}
here is the main file the main file
#include <stdio.h>
#include <stdlib.h>
#include "Btree.h"
int main()
{
Btree a = Create_Btree();
return 0;
}
this code is helping to implement the binary tree ,but when I try to run
the code gives the error undefined reference to 'Create_Btree'
it seems that the issue is with the link between the files