i need to generate a double number and i asked my instructor and forgot to send myself the file, my data is lost and i need help about but i remember he said something like this
my MAX and MIN and Value[SIZE] are double values but the program doesn't work.
It says something like
IntelliSense: expression must have integral or unscoped enum type
I made my MAX and MIN integers but now it says that that value is overrun. What should i do?
#include <chrono>
#include <iostream>
#include <random>
int main()
{
// Get values in [10,200)
constexprdouble MIN = 10;
constexprdouble MAX = 200;
std::mt19937 prng( std::chrono::system_clock::now().time_since_epoch().count() );
prng.discard( 10000 );
std::uniform_real_distribution<double> random( MIN, MAX );
// Get an array of values
constexpr std::size_t SIZE = 3;
double values[ SIZE ];
for (double& value : values)
value = random(prng);
// Print all the values in the array
for (double value : values)
std::cout << value << "\n";
}