#include <iostream>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
freopen("differ.inp","r",stdin);
freopen("differ.out","w",stdout);
int m,n;
scanf("%d %d\n",&m,&n);
char arr[m][n];
for(int i = 0;i<m;i++){
for (int j = 0;j<n;j++){
scanf("%c",&arr[i][j]);
}
scanf("\n");
}
char arr1[m][n];
for(int i = 0;i<m;i++){
for (int j = 0;j<n;j++){
scanf("%c",&arr1[i][j]);
}
scanf("\n");
}
int counter = 0;
for (int i = 0;i<m;i++){
for (int j = 0;j<n;j++){
if (arr[i][j]!=arr1[i][j]) counter++;
}
}
printf("%d",counter);
return 0;
}
What is the error here? Every time I try out with the char, it will show Segmentation (now it also has bus error). What is the problem here?