Using 2D array and calling it.

I am needing it to store *, which is INITIAL because of enum, in the board which is 5x5.
Like this,
*****
*****
*****
*****
*****

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 #include <iostream>
#include <cstdlib>
#include <iomanip>
#include <ctime>
using namespace std;

enum values {INITIAL = '*', MINE = '@'};
const int row = 5;
const int column = 5;

void initializeBoard (char array[row][column]);

int main()
{  
    values array[row][column];
    
    initializeBoard(array);//this function call might be wrong
    
    return 0;
}

void initializeBoard(char array[row][column])
{
    for (int i = 0; i < row; i++)
    {
        for (int j = 0; j < column; j++)
        {
            //what would I put here. I tried array[i][j]=INITIAL
        }
    }
    
}
Last edited on
Topic archived. No new replies allowed.