在C中链接二进制树

时间:2014-03-25 10:59:37

标签: c

我创建了一个程序,其中包含一个main函数,一个包含另一个函数的文件和一个头文件。 我的主要看起来像这样:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "header.h"

int main()
{...
show_in_postorder(root,0);
}

在文件中我有这个:

#include <stdio.h>
#include <stdlib.h>
#include "header.h"
void show_in_postorder (Tree *root, int level)
{...}

标题是:

#ifndef HEADER_H_INCLUDED
#define HEADER_H_INCLUDED

typedef struct Nodetype
{
    char nod;
    struct Nodetype *left,*right;
}Tree;
Tree *root;
void show_in_postorder (Tree *root, int level);
#endif // HEADER_H_INCLUDED

我得到的错误是:未定义对&#34; show_in_postorder&#34;的引用,在我在main中调用postorder函数的行。

0 个答案:

没有答案