So, basically as was just described it would look something like this:
1 2 3 4 5 6 7 8 9
//create random int between a - b | only works on positive numbers
int GetTrueRandomInt(int a, int b)
{
if (a >= b) // bad input
return a;
int c = (b - a) + 1;
return rand() % c + a;
}
If you wanted to get a random number using negative numbers then you would change the function to get the absolute value of c.