Hey guys, just wondering if anyone could give me an idea what this code does?
Code:static int randBetween(int low, int high)
{
if (low == high) return low;
if (low > high)
{
int tmp = low;
low = high;
high = tmp;
}
static bool firstTime = true;
if (firstTime)
{
srand((unsigned int)time(NULL));
firstTime = false;
}
int num = rand();
int result = num % (high - low + 1) + low;
return result;
}
class QuestionGenerator
{
public:
virtual const string& poseQuestion(void) = 0;
virtual bool isCorrectAnswer(const std::string& answer) const = 0;
};