class Item {
public:
enum TYPE { WEAPON, ARMOR, HEALTH };
Item( string name, Item::TYPE type, int power, int vitality, int health );
Item operator = ( Item& newItem );
Item( void );
// ~Item()
void setPower( int value );
int getPower( void );
void setVitality ( int value );
int getVitality ( void );
void setHealth( int value );
int getHealth( void );
void setName( string name );
void getName( void );
void setType( TYPE newType );
TYPE getType( void );
string mName;
int mPower;
int mVitality;
int mHealth;
TYPE mType;
bool mAvailable;
};
One obvious error I see in the Item class declaration is that getName() returns type void. Shouldn't it return a string?
If that's not your problem, please post the implementation of the Item constructor and the implementation of the get_name function. No need to post the entire Item.cpp file.