Hi,
I've been trying to fill an 6x6 array with random number from 1 to 6,
this is my function that takes care of this
but, when i print out the array, its elements are all the same ...Code:void initArray(int arrayName[][col], int row, int col) { for (int i =0; i<row; i++) { srand(static_cast<unsigned int>(time(NULL))); for (int j=0; j<col; j++) { arrayName[row][col]= 1+rand()%6; } } }
am I missing anything? (i cannot find anything that is wrong)
thanks for any insight