What I am trying to do is edit the variable of a class through a separate class function. I have tried to do things like

int player::attack(int *enemy)
     int randomNumber = rand() % 100;
     *consolePlayer.health = *consolePlayer.health - randomNumber;

and I get the error of :
`consolePlayer' undeclared (first use this function)

I know the anser is probably something I've accidentally overlooked, but could you please help?
Thank You,