Randomly select an integer from a vector that changes size

Hello, I am having a bit of trouble getting a Random value from a vector that is constantly changing sizes depending on the data that is inside, at first I thought I had it, but soon found out that I could not use:
float Random_Number = Rand() % Vector.size();
As... well... it's just getting a random value based on the size of the vector.

What I need is to access a random element of the Vector, I believe it is going to use:
Vector.at(random)
But I am unsure of how to get this to work.

Hopefully by the time I get a reply I would have figured it out, but if not, thank you in advance
Last edited on
I figured it out...

my solution was:

1
2
int Random = std::rand() % vector.size();
Selected_Element = Vector[Random];
Topic archived. No new replies allowed.