I'm laying out a framework for a game project that I'm interested in making. I have a generic class to handle each different type of object that will be in the game. Inside each class is a member called name which is a character array 8 elements long. Now since the name member is private, I have a member method called getName which is a method of a character type which simply returns the array held by the name member. I'll post the class in question as it's easier to see all of it.
Code:
class player{
private:
LOCATION currentLocation;
STATUS currentStatus;
WEAPONS currentWeapon;
BADGES currentBadge;
int currentHitPoints, maxHitPoints, speed, dexterity, intelligence,
numOfKills, numOfTimesKilled;
char name[];
public:
player();
int getCurHP(){return currentHitPoints;};
int getMaxHP(){return maxHitPoints;};
int getSpeed(){return speed;};
int getDexterity(){return dexterity;};
int getIntelligence(){return intelligence;};
int getNumOfKills(){return numOfKills;};
int getNumOfTimesKilled(){return numOfTimesKilled;};
char getName(){return name;};
LOCATION getCurLoc(){return currentLocation;};
STATUS getCurStatus(){return currentStatus;};
WEAPONS getCurWeapon(){return currentWeapon;};
BADGES getCurBadge(){return currentBadge;};
void incCurHP(int inc);
void decCurHP(int dec);
void incMaxHP(int inc);
void decMaxHp(int dec);
void incSpd(int inc);
void decSpd(int dec);
void incDex(int inc);
void decDex(int dec);
void incInt(int inc);
void decInt(int dec);
void incNumOfKills(int inc){numOfKills += inc;};
void incNumOfTimesKilled(int inc){numOfTimesKilled += inc;};
void setCurLoc(LOCATION newLoc);
void setCurStatus(STATUS newStatus);
void setCurWeapon(WEAPONS newWeapon);
void setCurBadge(BADGES newBadge);
void setName(char newName[]);
};
LOCATION, WEAPONS, STATUS, and BADGES are enumerations, just for clarification. Anyway, the line that contains the member method prototype for getName is the line that the compiler complains about. It says it's an invalid conversion from char* to char. It might be something small but I'm not picking up what it is I should be doing to fix this. Any ideas?? Thanks in advance.