Hey guys, this program is really giving me problems. I have done code, cleared it, done something else, cleared it, etc...

This is what I have so far, can anyone help direct me along the right path ,keeping with the instructions set?(using two dimensional array)

Code:

#include <iostream>
#include <iomanip>
using namespace std;
int checkx(char life_array[][],int row,int col,int num_neighbors);
const int n=12;
int main()
{
int row;
int col;
char life_array[n+2][n+2]; //original array
char new_array[n+2][n+2]; //array for next generation
int num_neighbors=0; //Neighbors of each square in generation
for(int num_gen=0;num_gen<8;num_gen++) //generation loop
//for 8 generations
{
cout<<setw(10)<<"Generation:"<<num_gen+1<<endl<<endl; //Header
for(row=1;row<n+2;row++) //Print Generation
{
cout<<endl;
for(col=1;col<n+2;col++)
{
cout<<life_array[row][col]<<" ";
}
}
for(row=1;row<n+2;row++)
{
cout<<endl;
for(col=1;col<n+2;col++)
{
if (life_array[row][col]='X')
{
num_neighbors=checkx(life_array[][],row,col,num_neighbors);
if (num_neighbors != 3)
new_array[row][col]=' ';
else
new_array[row][col]='X';
}
else
{
num_neighbors=checkx(life_array[][],row,col,num_neighbors);
if(num_neighbors != 2)
new_array[row][col]=' ';
else
new_array[row][col]='X';
}
}
}
for(row=1;row<n+2;row++)
for(col=1;col<n+2;col++)
new_array[row][col]=life_array[row][col];
return 0;
}
}
int checkx(char life_array[][n+2],int row,int col,int num_neighbors)
{
if life_array[row-1][col-1]='X';
num_neighbors++;
if life_array[row-1][col]='X';
num_neighbors++;
if life_array[row-1][col-1]='X';
num_neighbors++;
if life_array[row][col-1]='X';
num_neighbors++;
if life_array[row][col+1]='X';
num_neighbors++;
if life_array[row+1][col-1]='X';
num_neighbors++;
if life_array[row+1][col]='X';
num_neighbors++;
if life_array[row+1][col+1]='X';
num_neighbors++;
return num_neighbors;
}