Language: C++

#include<iostream>
using namespace std;
 
int main()
{
  bool m=false;
  int h;
  cin >> h;
  int w;
  cin >> w;
  char **a = new char*[h];
  for (int i=0; i<h;i++){
  	a[i] = new char[w];
  }
  
  bool **b = new bool*[h];
  for (int i=0; i<h;i++){
  	b[i] = new bool[w];
  }
  
  char c;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
    	while(cin>>c){
          a[i][j]=c;
          if(c=="#"){
          	b[i][j]=true;
          }else{
          	b[i][j]=false;
          }
    	}  
    }
  }
  int n=0;
  while(!m){
    n++;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(b[i][j]){
        if(i>0){a[i-1][j]="#";}
        if(i<h-1){a[i+1][j]="#";}
        if(j>0){a[i][j-1]="#";}
        if(j<w-1)a[i][j+1]="#";}
      }
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(a[i][j]=="#"){
      	b[i][j]=true;
      }
      if(!b[i][j]){
        m=true;
      }
    }
  }
  }
  cout >> n >> endl;
}
#include<iostream>
using namespace std;
 
int main()
{
  bool m=false;
  int h;
  cin >> h;
  int w;
  cin >> w;
  char **a = new char*[h];
  for (int i=0; i<h;i++){
  	a[i] = new char[w];
  }
  
  bool **b = new bool*[h];
  for (int i=0; i<h;i++){
  	b[i] = new bool[w];
  }
  
  char c;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
    	while(cin>>c){
          a[i][j]=c;
          if(c=="#"){
          	b[i][j]=true;
          }else{
          	b[i][j]=false;
          }
    	}  
    }
  }
  int n=0;
  while(!m){
    n++;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(b[i][j]){
        if(i>0){a[i-1][j]=="#";}
        if(i<h-1){a[i+1][j]=="#";}
        if(j>0){a[i][j-1]=="#";}
        if(j<w-1)a[i][j+1]=="#";}
      }
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(a[i][j]=="#"){
      	b[i][j]=true;
      }
      if(!b[i][j]){
        m=true;
      }
    }
  }
  }
  cout << n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |           if(c=="#"){
      |              ~^~~~~
a.cc:40:27: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   40 |         if(i>0){a[i-1][j]="#";}
      |                           ^~~
      |                           |
      |                           const char*
a.cc:41:29: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   41 |         if(i<h-1){a[i+1][j]="#";}
      |                             ^~~
      |                             |
      |                             const char*
a.cc:42:27: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   42 |         if(j>0){a[i][j-1]="#";}
      |                           ^~~
      |                           |
      |                           const char*
a.cc:43:28: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   43 |         if(j<w-1)a[i][j+1]="#";}
      |                            ^~~
      |                            |
      |                            const char*
a.cc:49:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   49 |       if(a[i][j]=="#"){
      |          ~~~~~~~^~~~~
a.cc: At global scope:
a.cc:58:3: error: 'cout' does not name a type
   58 |   cout >> n >> endl;
      |   ^~~~
a.cc:59:1: error: expected declaration before '}' token
   59 | }
      | ^
a.cc:63:5: error: redefinition of 'int main()'
   63 | int main()
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main()
      |     ^~~~
a.cc: In function 'int main()':
a.cc:85:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   85 |           if(c=="#"){
      |              ~^~~~~
a.cc:99:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   99 |         if(i>0){a[i-1][j]=="#";}
      |                 ~~~~~~~~~^~~~~
a.cc:100:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  100 |         if(i<h-1){a[i+1][j]=="#";}
      |                   ~~~~~~~~~^~~~~
a.cc:101:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  101 |         if(j>0){a[i][j-1]=="#";}
      |                 ~~~~~~~~~^~~~~
a.cc:102:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  102 |         if(j<w-1)a[i][j+1]=="#";}
      |                  ~~~~~~~~~^~~~~
a.cc:108:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  108 |       if(a[i][j]=="#"){
      |          ~~~~~~~^~~~~
a.cc: At global scope:
a.cc:117:3: error: 'cout' does not name a type
  117 |   cout << n << endl;
      |   ^~~~
a.cc:118:1: error: expected declaration before '}' token
  118 | }
      | ^