一个简单的单独编译测试。用的ide是dev C++,第一次成功,但后来几次打开都编译失败,求大神赐教

图片说明
图片说明
//golf.h
#ifndef GOLF_H_
#define GOLF_H_
const int length=20;
struct golf
{
char fullname[length];
int handicap;
};
void setgolf(golf &,const char*,int);
int setgolf(golf &);
void handicap(golf &,int);
void showgolf(const golf &);
#endif

//golf.cpp
#include
#include
#include"golf.h"
static int i;
void setgolf(golf & g,const char* name,int hc)
{
for(i=0;i<strlen(name);i++)
g.fullname[i]=name[i];
g.handicap=hc;
}

int setgolf(golf & g)
{
std::cout<<"Enter your name:";
std::cin.getline(g.fullname,length);
if(g.fullname[0])
{
std::cout<<"Enter your num:";
if(std::cin>>g.handicap)
{
std::cin.get();
return 1;
}
else
return 0;
}
else
return 0;
}

void handicap(golf & g,int hc)
{
g.handicap=hc;
}
void showgolf(const golf & g)
{
using namespace std;
cout<<"FULLNAME ";
for(i=0;i<strlen(g.fullname);i++)
cout<<g.fullname[i];
cout<<endl<<"HANDICAP "<<g.handicap<<endl;
}

//execute_golf
#include"golf.h"
const int size=10;
/*void setgolf(golf &,const char*,int);
int setgolf(golf &);
void handicap(golf &,int);
void showgolf(const golf &);*/
int main()
{
int i;
golf pc=new golf[size];
for(i = 0;i < size;i++)
{
if(!setgolf(
(pc+i)))
break;
}
for(int j=0;j<i;j++)
showgolf(*(pc+j));

}

一开始还以为是编译器问题,没想到是不会玩编译器图片说明
把这三个文件链接到一个项目里就行了(给我整笑了

int setgolf(golf & g)
这个是传引用
setgolf(*(pc+i))这个不是
两个修改其一