I'm trying to write a piece of code that goes through a random element of a string array and then outputs it. After it outputs it then sets that element to 0. And then that if statement ensures that name will not be outputted again.
void group(){
int random = rand() % 50;
int i, j = 0;
while(j<50){
srand(0);
random = rand() % 50;
groupNum = 1;
cout << "Group " << groupNum << " has: ";
if(names[random] != "0"){
cout << names[random] << " ";
names[random] = "0";
j++;
}
if(names[random] == "0"){
continue;
}
i++;
if(i == peoplePerGroup){
groupNum++;
cout << "\n\n";
i=0;
}
}
}