I am using g++ to compile this for school and I keep getting this message:
error: expected primary-expression before â=â token
I've looked around and still, even on google I can't find out what is wrong. I've been at it for a few hopurs now changing things up and reading but still can't get it to run any suggestions?
class Hitter:public BaseballPlayer
{
char bats;
int hits;
int atbats;
float average;
public:
Hitter(string name = "", int h = 0, int w = 0, char b = BATS_UNINITIALIZED, int ab = 0, int numHits = 0);
float calc_average();
virtual void load_player(ifstream&);
virtual void print_player() const;
char get_bats() const;
int get_hits() const;
int get_atbats() const;
float get_average() const;
};
The error appears in the constructor, here is the implementation:
Hitter::Hitter(string name, int h, int w, char b, int ab, int numHits):BaseballPlayer(name, h, w)
{
bats = b;
hits = numHits;
atbats = ab;
That was it. Thanks a lot for your help guys. Now it's time for some new compile errors that need fixing. Thanks again. I've been working on this for hours.