I've got a weird problem trying to generate a random number between two values.
Both maxDegree and minDegree are integers passed into the method. maxDegree is always larger than minDegree.Code:int degree; degree = rand() % maxDegree + minDegree;
However, the output of degree seems to produce results larger than maxDegree. Any thoughts on this? I'm stumped!


LinkBack URL
About LinkBacks
Reply With Quote
.
SCAN.care@HEXUS
