PDA

View Full Version : Select A Random Array



TehNeonFishy
11-16-2012, 09:36 PM
I've got a list of 10 null terminated arrays, I need to randomly select one of them. I can't seem to figure out a method to randomly select a character array. Unless there is a easier way of doing it? I'm not allowed to use the string data type. ¬¬

tls
11-16-2012, 09:56 PM
Make the list into an array, then randomly choose an index of that array with http://www.cplusplus.com/reference/clibrary/cstdlib/rand/ .

TehNeonFishy
11-16-2012, 10:02 PM
Could I have an array of arrays? >.< Since I can't use the string data type, all my strings are in arrays already.

Enslaved
11-16-2012, 10:08 PM
do a multidimentional array?

tls
11-16-2012, 10:20 PM
char[][] arr;

TehNeonFishy
11-16-2012, 11:21 PM
I've heard of them, I'll have a look into it. Thanks. :D