As it is only 3 lines of code do you need a function?
const int MAXROW = 4;
const int MAXCOL = 10;
int main()
{
int a [MAXROW][MAXCOL];
for (int row = 0; row < MAXROW; row++)
for (int col = 0; col < MAXCOL; col++)
a[row][col] = rand () % 10;
}