SRL Archive - C/C++ Help and Tutorials

Select A Random Array


TehNeonFishy

2012-11-16 16:36:37

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. ¬¬

mormonman

2012-11-16 16:56:12

Make the list into an array, then randomly choose an index of that array with http://www.cplusplus.com/reference/clibrary/cstdlib/rand/ .

TehNeonFishy

2012-11-16 17:02:14

Could I have an array of arrays? >.< Since I can't use the string data type, all my strings are in arrays already.

Enslaved

2012-11-16 17:08:45

do a multidimentional array?

mormonman

2012-11-16 17:20:33

char[][] arr;

TehNeonFishy

2012-11-16 18:21:08

I've heard of them, I'll have a look into it. Thanks. :D