In my header file
The function I'm using is
This function passes a string from the Interface class, which is the player's name that they type in but when the function tries to set name_ to that value it throws up an access violation.
Could anyone shed some light on this please?
class Player {
public:
//constructor
Player();
Score score_;
//assessors
void setName(string inputtedName);
string getName() const;
int getScoreAmount() const;
//mutators
void updateScoreAmount(int i);
private:
string name_;
};
#endif
The function I'm using is
void Player::setName(string inputtedName)
{
name_ = inputtedName;
}
This function passes a string from the Interface class, which is the player's name that they type in but when the function tries to set name_ to that value it throws up an access violation.
Could anyone shed some light on this please?