0

Hello,
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)
{
     srand(time(NULL));
     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,
EpicAsian

Edited by epicasian: n/a

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by epicasian
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.