I see here that you use string. Are you allowed to do that?
Anyway, to be correct you should also
#include <string>
Are you sure your teacher said that you need a two dimensional array for this?
I can't see how that would be useful but maybe I'm missing something...
Maybe he said that you need two arrays. Could we see the assignment?
Are you supposed to write the algorithm yourself or can you use the standard library algorithms?
If it's the latter, this could help ->
http://cplusplus.com/reference/algorithm/random_shuffle/
If it's the former, you could use a two-level for loop to do random swaps of the elements of the array, like this:
1 2 3 4 5 6 7
|
for (int i=0; i<10; i++)
{
for (int j=i; j<10; j++)
{
//do your swaps here
}
}
|
Regarding the grouping, does it have to be done in your code or just in the program output?
If it's the latter you can just print a newline character after every three names when you print your array.
Else, just create three arrays do some copying. It's not that difficult, really.
Now, something else I want to ask. Why are there both "tobi" and "madara" in your array?
They are the same person, aren't they? And who's "budz"?