Witam. Robię program wieloplikowy, jest to w sumie jeden z moich pierwszych jak nie pierwszy taki rozłączny program. Kompilując wyrzuca mi kilka błędów.
Screen jakie błędy wyrzuca: http://ifotos.pl/zobacz/plik-rozl_qrqsqhp.png
Kod:
#include <iostream>
#include "golf.hpp"
int main()
{
golf andy;
setgolf(andy);
showgolf(andy);
setgolf(andy,"Ann Birdfree",24);
showgolf(andy);
handicap(andy, 31);
showgolf(andy);
return 0;
}
const int Len = 40;
struct golf
{
char fullname[Len];
int handicap;
};
void setgolf(golf & g, const char * name,int hc);
void setgolf(golf & g);
void handicap(golf & g, int hc);
void showgolf(const golf & g);
#include <iostream>
#include <cstring>
#include "golf.h"
using std::cin;
using std::cout;
using std::endl;
void setgolf(golf &g, const char * name,int hc)
{
strcpy(g.fullname,name);
g.handicap=hc;
}
void setgolf(golf &g)
{
cout<<"Podaj nazwisko: ";
cin>>g.fullname;
if(g.fullname==false)
cout<<"0"<<endl;
else cout<<"1"<<endl;
cout<<"Podaj handicap: ";
cin>>g.handicap;
}
void handicap(golf & g, int hc)
{
g.handicap=hc;
}
void showgolf(const golf & g);
{
cout<<"Nazwisko :"<<g.fullname<<endl;
cout<<"Handicap :"<<g.handicap<<endl;
}