Difficulty on finding what is causing this error

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;

average = calc_average();
}

Thanks everyone.
-Pat
What line is it on (exactly)?
There error indicates that it's on line 37 in .h which is the:

Hitter(string name = "", int h = 0, int w = 0, char b = BATS_UNINITIALIZED, int ab = 0, int numHits = 0);



You need to put your code in code tags.
Where do you define the field for BATS_UNINITIALIZED?
just before:

class Hitter:public BaseballPlayer
{


looks like this:

#include<iostream>
#include<fstream>
#include "BaseballPlayer.h"

#ifndef HITTER_H
#define HITTER_H

using namespace std;

#define BATS_UNINITIALIZED = 'U'

class Hitter:public BaseballPlayer
{


Hmmm... try replacing bats_uninitialized (in your constructor) with the character 'U'. Do you still get an error?
closed account (1yR4jE8b)
When you define a preprocessor macro, you don't assign it.

You have:

#define BATS_UNITIALIZED = 'U'

it should just be

#define BATS_UNITIALIZED 'U'
It does get rid of it.
If I had a specific value like in that case, I'd rather define const char BATS_UNINITIALIZED = 'U'; than a preprocessor macro.
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.
Topic archived. No new replies allowed.