I wrote a simple random generator for my code and it's work perfectly. Only promblem is it do not create any number bigger than 5 digit.
int *numbers;
void Random()
{
srand(time(NULL));
cout << "Choose the amounth of the random values to create: ";
cin >> amount;
int max;
cout << "Choose the max limit of the random numbers: ";
cin >> max;
numbers = new int[amount];
//Create random
for (int i = 0; i < amount; i++)
{
randomNumber = rand() % max;
numbers[i] = randomNumber;
cout << randomNumber << endl;
}
}
When max is 1.000 (amount 10):
output: 12, 565, 404, 250, 745, 941, 814, 83, 277, 518when max is 100.000 (amount 10):
output: 2592, 7665, 16438, 10927, 30746, 10054, 22957, 12322, 7029, 9814when max is 10.000.000 (amount 10):
output: 2931, 11387, 6536, 23144, 22117, 25218, 18972, 2797, 20299, 25775
I thought maybe it was my luck why they are that small and i tryed multiple times. Even if i make the amount thousand nothing change, always small numbers.