Random numbers into 2d array

hi,i am trying to print a 2d (4*4) array,filling it with random numbers,however when i print, all elements are shown as zero. please help

1
2
3
4
5
6
7
8
9
10
11
12
  void print()
{

	for(int rows=0;rows<row;rows++)
	{
		for(int cols=0;cols<col;cols++)

			cout << setw(5) << myArray[rows][cols] << "" ;
		    cout << endl;
	}

}
Is it because you forgot to initialize your array?

Where are you filling your array with random numbers?
i want to initialize my array by means of filling it with random numbers?
You want the user to pick those random numbers or you want the script to pick random numbers, as in srand(time(null)) ?
the script....not the user
i have managed to figure it out. thanks darqan and seiza
Topic archived. No new replies allowed.