Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- undefined reference to `setgolf(golf&, char*, int)'
- collect2: error: ld returned 1 exit status
- #ifndef SANS_H_INCLUDED
- #define SANS_H_INCLUDED
- const int len = 40;
- struct golf
- {
- char fullname[len];
- int handicap;
- };
- //void setgolf(golf &,char * ,int);
- int setgolf(golf &);
- void sethandicap(golf &,int );
- void showgolf(const golf &);
- #endif
- #include <iostream>
- #include <cstring>
- #include "chapter9exe3.h"
- void setgolf(golf & s,char *c ,int hc)
- {
- strcpy(s.fullname,c);
- s.handicap=hc;
- }
- int setgolf(golf & s)
- {
- std::cin.getline(s.fullname,len);
- if(s.fullname[0] == '