lundi 30 mai 2016

Randomly select from a string array and set equal to variable

I want to randomly select a word from a string array and set it equal to a variable, doing this 10 times, each time getting a different word from the array and setting it equal to a different variable. Can anyone help?

string v1, v2, v3, v4, v5, v6, v7, v8, v9, v10;

string words[] = {"WORD1", "WORD2", "WORD3", "WORD4", "WORD5", "WORD6", "WORD7", "WORD8", "WORD9", "WORD10";




Aucun commentaire:

Enregistrer un commentaire