我正在为二进制搜索树编写头文件,但是当我编译 Visual Studio 2012 编译器时,编译器无法识别 stdbool.h 头文件。我收到此错误:
error C1083: Cannot open include file: 'stdbool.h': No such file or directory
为什么我会收到此错误?
我用代码块编译器尝试了它,仍然得到同样的错误,我将在下面发布我的文件提前谢谢你的帮助。
/二叉搜索树的头文件/
#include <stdio.h>
#include <stdbool.h>
// Structure Declarations
typedef struct
{
void* dataPtr;
struct node* left;
struct node* right;
}NODE;
typedef struct
{
int count;
int (*compare) (void* argu1, void* argu2);
NODE* root;
}BST_TREE;
// Prototype declarations
BST_TREE* BST_Create
(int (*compare) (void* argu1, void* agu2));
BST_TREE* BST_Destroy (BST_TREE* tree);
bool BST_Insert (BST_TREE* tree, void* dataPtr);
bool BST_Delete (BST_TREE* tree, void* dltKey);
void* BST_Retrieve (BST_TREE* tree, void* dataPtr);
void* BST_Traverse (BST_TREE* tree,
void (*process) (void* dataPtr));
bool BST_Empty (BST_TREE* tree);
bool BST_Full (BST_TREE* tree);
int BST_Count (BST_TREE* tree);
static NODE* _insert
(BST_TREE* tree, NODE* root,
NODE* newPtr);
static NODE* _delete
(BST_TREE* tree, NODE* root,
void* dataPtr, bool* success);
static NODE* _retrieve
(BST_TREE* tree,
void* dataPtr, NODE* root);
static NODE* _traverse
(NODE* root,
void (*process) (void* dataPtr));
static NODE* _destroy ( NODE* root);