Guide me for my program..two dimentional array..

guys pls help me about my program.. my problem is i dont know how to use the 2D arrays.. pls guide my program how to random the student names and it will GROUP into three members of names. i have here a code but my problem is the the name will random into more than one, i dont know how to random it into once only and i dont know how to group it into three members of names,, pls help me guys.
heres my code..

#include <iostream>
#include <stdlib.h>
#include <string.h>

using namespace std;
int x, stud;
int group[36];
int check[36];

int main()
{string NameArray[36] = {"capili","roces" ,"florez","carpio","almeria","sumanting","Lim","daviza","angulo","macadangdang","tulio","abad","tejadillo","balbarona","caballes","ipong","clemente","junsay","deypalubos","lines","quino","yaun","moril","arastam","laurente","montajes","racho","david","umanan","fampulme","suratos","oliveros","tobi","madara"};

cout<< "Before the Name Random\n";

for (int i =0; i <=35; i++)

{

cout << NameArray[i] << endl;
}
cout << endl;
cout <<"After the randomizing\n";

srand( (unsigned)time(0) );
for(int j=9; j>1; j--)
{
int r = rand()%j;// produces a random # between 0 and j-1 inclusive.
// TODO: Swap elements j and r. Please work this part out
}

for (int j =0; j<=35; j++)

{
string Random;
Random = NameArray[rand()%36];
cout << Random << endl;
NameArray[j]=Random;
}

system("PAUSE");
return 0;
}
Topic archived. No new replies allowed.