Im having an issue regarding visual studio and the use of random. If i run the following code in the linux based Ubuntu, or even just using CMD a random number is produced everytime. However, when using visual studio code the number 3 is constantly returned in a sample size of 10 attempts. Does anyone know why this is happening or if visual studio code just doesn't support the use of random for C++? This is is definitely an issue with visual studio code.
#include <iostream>
#include <random>
int main()
{
std::random_device random_device;
std::mt19937 engine{random_device()};
std::uniform_int_distribution<int> dist(0, 6);
int random_index = dist(engine);
std::cout << "This is a random number" << random_index;
return 0;
}