I am attempting to inline a member function as an argument of an equation.
Code:
Player.hitper=((d10.roll-1)*10)+(d10.roll-1);
d10 is a object of the class dice.
The class to which the function belongs is as follows:
Code:
class dice
{
public:
dice(int sides);
int numsides;
int roll()
{
(rand()%numsides)+1;
}
};
The error I'm receiving is as follows:
invalid use of member (did you forget the `&' ?)
I have tried to use the function with and without the 'return' keyword preceding the statement in the function.
What am I doing wrong here?