C++ Problem

This is the problem:
Write a program that randomly fills in 0s and 1s into a 4x4 matrix, prints the matrix, and finds the row and column that have the most 1s. If there is a tie, multiple columns should be listed. For example, a run of the program might look like this:

0001
0110
1011
0011

Row 3 has the most 1s.

Columns 3 and 4 have the most 1s.


This is my code so far:
#include <iostream>
using namespace std;

const int DOWN = 4;
const int ACR = 4; // usable in any part of the program

void fill_ara(int [] [ACR]);
void show_ara(int [] [ACR]);

int main()
{ char player1;
char player2;
char s;

int ara[DOWN][ACR];
fill_ara(ara);
show_ara(ara);


return 0;
}
void fill_ara(int ara[][ACR])
{
int cnt = 0;
for (int d =0; d < DOWN; d++)
{
for(int a = 0;a < ACR; a++)
{ cnt++;
ara[d][a] = cnt;
}
}
return;
}

void show_ara(int ara[][ACR])
{
for (int d =0; d < DOWN;d++)
{
for(int a =0; a < ACR; a++)
cout << ara[d][a] << " ";
cout << endl;
}
return;
}


Can anyone help me continue?
1. learn random number program
2. learn how to send and receive arrays to functions.

search beginners forum, you'll find many examples in these two.
Topic archived. No new replies allowed.