Can someone please give me tips on how to accomplish generating a random number within a random range. See 'roll_dice'
#include <iostream>
#include <limits>
#include <ctime>
#include <iomanip>
#include <cstdlib>
using namespace std;
using std::cout;
using std::cin;
struct Sanity {
unsigned int turns = std::numeric_limits<int>::max();
unsigned int sanity = std::numeric_limits<int>::max();
int randNum = 0;
int choice = 0;
int low = 0;
int high = 0;
};
void game_greeting();
int roll_dice(Sanity& s1);
int even_odd(Sanity& s1);
int main()
{
Sanity s1;
game_greeting();
roll_dice(s1);
even_odd(s1);
}
int roll_dice(Sanity &s1)
{
srand(time(NULL));
s1.randNum = rand() % roll_dice(s1) + roll_dice(s1);
return s1.randNum;
}