Language: C++

#include <iostream>
#define N 100
#define M 100
#define inrange(i,j) ((i)>=0&&(i)<m&&(j)>=0&&(j)<n)
using namespace std;

int main(void){
	int m,n,c;
	cin>>m>>n;
	bool m[M][N];
	for(int i=0;i<m;i++){
		for(int j=0;j<n;j++){
			m[i][j]=true;
		}
	}
	for(int i=0;i<m;i++){
		for(int j=0;j<n;j++){
			cin>>c;
			if(c=='x'){
				if(inrange(i,j))m[i][j]=false;
				if(inrange(i+1,j))m[i+1][j]=false;
				if(inrange(i-1,j))m[i-1][j]=false;
				if(inrange(i,j+1))m[i][j+1]=false;
				if(inrange(i,j-1))m[i][j-1]=false;
				if(inrange(i+1,j+1))m[i+1][j+1]=false;
				if(inrange(i-1,j+1))m[i-1][j+1]=false;
				if(inrange(i+1,j-1))m[i+1][j-1]=false;
				if(inrange(i-1,j-1))m[i][j]=false;
			}else if(c=='o'){
				if(inrange(i,j))m[i][j]=false;
				if(inrange(i,j+1))m[i][j+1]=false;
				if(inrange(i,j-1))m[i][j-1]=false;
			}
		}
	}
	int c=0;
	for(int i=0;i<m;i++){
		for(int j=0;j<n;j++){
			if(m[i][j])c++;
		}
	}
	cout<<c<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: conflicting declaration 'bool m [100][100]'
   10 |         bool m[M][N];
      |              ^
a.cc:8:13: note: previous declaration as 'int m'
    8 |         int m,n,c;
      |             ^
a.cc:13:26: error: invalid types 'int[int]' for array subscript
   13 |                         m[i][j]=true;
      |                          ^
a.cc:20:50: error: invalid types 'int[int]' for array subscript
   20 |                                 if(inrange(i,j))m[i][j]=false;
      |                                                  ^
a.cc:21:52: error: invalid types 'int[int]' for array subscript
   21 |                                 if(inrange(i+1,j))m[i+1][j]=false;
      |                                                    ^
a.cc:22:52: error: invalid types 'int[int]' for array subscript
   22 |                                 if(inrange(i-1,j))m[i-1][j]=false;
      |                                                    ^
a.cc:23:52: error: invalid types 'int[int]' for array subscript
   23 |                                 if(inrange(i,j+1))m[i][j+1]=false;
      |                                                    ^
a.cc:24:52: error: invalid types 'int[int]' for array subscript
   24 |                                 if(inrange(i,j-1))m[i][j-1]=false;
      |                                                    ^
a.cc:25:54: error: invalid types 'int[int]' for array subscript
   25 |                                 if(inrange(i+1,j+1))m[i+1][j+1]=false;
      |                                                      ^
a.cc:26:54: error: invalid types 'int[int]' for array subscript
   26 |                                 if(inrange(i-1,j+1))m[i-1][j+1]=false;
      |                                                      ^
a.cc:27:54: error: invalid types 'int[int]' for array subscript
   27 |                                 if(inrange(i+1,j-1))m[i+1][j-1]=false;
      |                                                      ^
a.cc:28:54: error: invalid types 'int[int]' for array subscript
   28 |                                 if(inrange(i-1,j-1))m[i][j]=false;
      |                                                      ^
a.cc:30:50: error: invalid types 'int[int]' for array subscript
   30 |                                 if(inrange(i,j))m[i][j]=false;
      |                                                  ^
a.cc:31:52: error: invalid types 'int[int]' for array subscript
   31 |                                 if(inrange(i,j+1))m[i][j+1]=false;
      |                                                    ^
a.cc:32:52: error: invalid types 'int[int]' for array subscript
   32 |                                 if(inrange(i,j-1))m[i][j-1]=false;
      |                                                    ^
a.cc:36:13: error: redeclaration of 'int c'
   36 |         int c=0;
      |             ^
a.cc:8:17: note: 'int c' previously declared here
    8 |         int m,n,c;
      |                 ^
a.cc:39:29: error: invalid types 'int[int]' for array subscript
   39 |                         if(m[i][j])c++;
      |                             ^