how to create a boundry around a grid
<p>the program is supposed to output a grid of 12x24 with the all the outside line outputting 0 and the inside ones outputting 1</p>

<p>this is what i tried in order to get the first column and row to output 0:</p>

<pre><code>#include &lt;iostream&gt;

using namespace std;
#define N 24
// print:
//
// Prints the simulation matrix M as spaces, *'s, and T's.
//
void print(int M[][N], int ROWS, int COLS)
{
// YOU MUST IMPLEMENT THIS:
}
//
// fill:
//
// Fills the simulation matrix such that the boundary rows
// and columns are empty, the internal area is all trees,
// and one tree is burning at index position (row, col).
//
void fill(int M[][N], int ROWS, int COLS, int row, int col)
{
// YOU MUST IMPLEMENT THIS:

//
// main:
}//
int main()
{
int M[N/2][N];
int ROWS, COLS;
int r, c;
ROWS = sizeof(M) / sizeof(M[0]);
COLS = sizeof(M[0]) / sizeof(M[0][0]);
fill(M, ROWS, COLS, 1, 1);
for(r=0; r&lt; ROWS; r++)
{
for(c=0; c&lt; COLS; c++)
{
    if(ROWS&gt;1)
    {
    M[ROWS][COLS]=1;
    cout&lt;&lt; M[ROWS][COLS];
    }
    else
    {

    M[ROWS][COLS]=0;
    cout&lt;&lt; M[ROWS][COLS];
}
}
cout&lt;&lt; endl;
}

print(M, ROWS, COLS);
return 0; 
}
</code></pre>

<p>How can this be done?</p>
