这个代码是哪里出有关问题了

这个代码是哪里出问题了?
这个代码是哪里出有关问题了十分感谢
#include<stdlib.h>
#include<stdio.h>
#include <conio.h>
#include<string.h>
#include<windows.h>
#include<malloc.h>
#include<iostream>
using namespace std;


typedef struct position   //文件编号存储
{
int p;               //当前文件编号
struct position *np;  //下一个文件编号指针
}position,*Position;

typedef struct word
{
char key[20];         //关键词
int last;             // 关键词长度
position *fp;         // 第一个文档编号指针
struct word *next;     // 下一个关键词
struct word *front;     //   上一个关键词
}word,*Word;

typedef struct head
{
int num;              //目前关键词数量
word *first;          //第一个关键词指针
word *last;//最后一个关键词指针
}head;

void init(head *h)//初始化索引表存储结构体
{
h->first=h->last=(word*)malloc(sizeof(word));
h->first->next=h->last;
h->last->front=h->first;
h->num=0;

}

int n=0;       //文件编号
int file=3;     // 文件夹编号
char p[100];    // 路径

void main()
{
void creatlist();   
void search();

int f;           //选择功能标记
char a;          //无用的
cout<<"        1.建立索引表"<<endl;
cout<<"        2.检索关键词"<<endl;
cout<<"\n选择功能:";
cin>>f;

cout<<"输入文件路径(eg:D:\\fengci ): ";
cin>>p;


if(f==1)
creatlist();         //建立索引表
else if(f==2)
search();              //检索关键词
a=getch();
}



void path(char p[],char s[])            //生成每个文件路径
{
int i;
strcpy(s,p);
if(file==1)
strcat(s,"\\C000007\\");
if(file==2)