0

I'm trying to write a program that randomly picks n number of elements from a vector

i figured out to use a for loop to print a random index of the vector n times but how do i make it not repeat an index more than onece?

5th Apr 2018, 3:21 AM
Fig
Fig - avatar
2 Respuestas
+ 1
std::set<size_t> used_indices;
5th Apr 2018, 10:18 AM
Timon Paßlick