I need to generate random numbers within a specified interval, [max;min].
Also, the random numbers should be uniformly distributed over the interval, not located to
Of course, the following code won't give you random numbers but pseudo random number. Use the following code
#define QUICK_RAND(m,n) m + ( std::rand() % ( (n) - (m) + 1 ) )
For example:
int myRand = QUICK_RAND(10, 20);
You must call
srand(time(0)); // Initialize random number generator.
otherwise the numbers won't be near random.