Results 1 to 6 of 6

Thread: Select A Random Array

  1. #1
    Join Date
    May 2012
    Location
    Draynor Willows
    Posts
    498
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Select A Random Array

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

  2. #2
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

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

  3. #3
    Join Date
    May 2012
    Location
    Draynor Willows
    Posts
    498
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

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

  4. #4
    Join Date
    Jan 2012
    Location
    127.0.0.1
    Posts
    702
    Mentioned
    11 Post(s)
    Quoted
    76 Post(s)

    Default

    do a multidimentional array?

  5. #5
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    char[][] arr;

  6. #6
    Join Date
    May 2012
    Location
    Draynor Willows
    Posts
    498
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •