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



LinkBack URL
About LinkBacks


