generate a sequence of numbers from an array

Jun 4, 2013 at 1:09pm
I have 2D array of size 10*10.
I need to generate 10 array indexs from array index 10*10 at one time.
How can i do that?
Last edited on Jun 4, 2013 at 1:09pm
Jun 4, 2013 at 1:16pm
Do you mean generate random indices?
Please give more detail, I do not understand what you need to do.
Jun 4, 2013 at 1:18pm
generate 10 random numeber in [0; 100) range, convert them into 2D indexes.
Jun 4, 2013 at 1:36pm
int index = std::rand() % 100;

int row = index / 10;
int column = index % 10;
Topic archived. No new replies allowed.